File tree Expand file tree Collapse file tree 5 files changed +30
-38
lines changed
Expand file tree Collapse file tree 5 files changed +30
-38
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ jobs:
106106 PUBLISH_USER : ${{ secrets.PUBLISH_USER }}
107107 PUBLISH_KEY : ${{ secrets.PUBLISH_KEY }}
108108 run : |
109- ./gradlew publishToMavenCentral --stacktrace
109+ ./gradlew publishToMavenCentral -Psnapshot - -stacktrace
110110
111111 sonar :
112112 needs : [test]
Original file line number Diff line number Diff line change 11plugins {
22 base
33 alias(libs.plugins.jacoco)
4- id(" io.openapiprocessor.build.plugin.publish-central " )
4+ id(" io.openapiprocessor.build.plugin.publish" )
55}
66
7+ group = " io.openapiprocessor"
8+ version = libs.versions.openapiparser.get()
9+ println (" version: $version " )
10+
711repositories {
812 mavenCentral()
913}
@@ -13,12 +17,19 @@ tasks.named("build") {
1317 dependsOn (" jacocoLogAggregatedCoverage" )
1418}
1519
16- group = " io.openapiprocessor"
17- version = libs.versions.openapiparser.get()
18- println (" version: $version " )
19-
20- publishProcessor {
20+ publishingCentral {
2121 stagingDir = layout.buildDirectory.dir(" staging" )
2222 deploymentDir = layout.buildDirectory.dir(" deployment" )
23- publish = false
23+ deploymentName = " parser"
24+ }
25+
26+ afterEvaluate {
27+ if (hasProperty(" snapshot" )) {
28+ tasks.named(" publishAllReleasesToMavenCentral" ) {
29+ enabled = version.toString().endsWith(" SNAPSHOT" )
30+ if (! enabled) {
31+ logger.warn(" skipping publishing because version is not a snapshot." )
32+ }
33+ }
34+ }
2435}
Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ pluginManagement {
44 repositories {
55 gradlePluginPortal()
66 mavenCentral()
7+ maven {
8+ url = uri(" https://central.sonatype.com/repository/maven-snapshots" )
9+ mavenContent {
10+ snapshotsOnly()
11+ }
12+ }
713 }
814}
915
Original file line number Diff line number Diff line change 1- import io.openapiprocessor.build.core.dsl.initFrom
2- import io.openapiprocessor.build.core.dsl.initSignKey
3- import io.openapiprocessor.build.core.dsl.sonatype
4- import io.openapiprocessor.build.core.getPomProperties
5- import org.gradle.accessors.dm.LibrariesForLibs
6-
71plugins {
82 `maven- publish`
9- signing
10- id(" io.openapiprocessor.build.plugin.publish-base" )
3+ id(" io.openapiprocessor.build.plugin.publish" )
114}
125
13- // central plugin setup must run in the context of the applying project
14- plugins.apply (" io.openapiprocessor.build.plugin.publish-central" )
15-
16- // see buildSrc/build.gradle.kts
17- val libs = the<LibrariesForLibs >()
18-
196val componentName = if (isPlatform()) { " javaPlatform" } else { " java" }
207
218publishing {
229 publications {
2310 create<MavenPublication >(" openapiparser" ) {
2411 from(components[componentName])
25-
26- pom {
27- pom.initFrom(getPomProperties(project))
28- }
2912 }
3013 }
31-
32- repositories {
33- sonatype(project)
34- }
35- }
36-
37- signing {
38- initSignKey()
39- sign(publishing.publications[" openapiparser" ])
4014}
4115
42- publishProcessor {
16+ publishingCentral {
17+ publication = " openapiparser"
4318 stagingDir = rootProject.layout.buildDirectory.dir(" staging" )
4419 deploymentDir = rootProject.layout.buildDirectory.dir(" deployment" )
45- publish = false
20+ deploymentName = " parser "
4621}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ openapiparser = "2025.4-SNAPSHOT"
33
44build-jdk = " 11"
55test-jdk = " 17"
6- build-plugins = " 2025.4 -SNAPSHOT"
6+ build-plugins = " 2025.7 -SNAPSHOT"
77
88# using the embedded kotlin version of gradle to avoid mixed versions
99kotlin = " 2.2.10"
You can’t perform that action at this time.
0 commit comments