File tree Expand file tree Collapse file tree 4 files changed +61
-15
lines changed Expand file tree Collapse file tree 4 files changed +61
-15
lines changed Original file line number Diff line number Diff line change 22set -e
33mvn -T 10 clean install
44./plugins/idea/gradlew -b plugins/idea/build.gradle clean buildPlugin
5- mvn -f plugins/eclipse/pom.xml clean install
5+ mvn -T 10 - f plugins/eclipse/pom.xml clean install
66./plugins/gradle/gradlew -b plugins/gradle/build.gradle clean assemble validatePlugins publishToMavenLocal
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ plugins {
44 id ' java-gradle-plugin'
55 id ' groovy'
66 id ' maven-publish'
7+ id " org.jreleaser" version " 1.20.0"
78 id ' signing'
89 id ' eclipse'
910}
@@ -97,13 +98,49 @@ publishing {
9798 }
9899 }
99100 repositories {
101+ if (project. version. toString(). endsWith(" -SNAPSHOT" )) {
102+ // snapshots are going to sonatype
103+ maven {
104+ credentials {
105+ username = System . getenv(" MAVEN_USERNAME" )
106+ password = System . getenv(" MAVEN_PASSWORD" )
107+ }
108+ url = uri(" https://central.sonatype.com/repository/maven-snapshots/" )
109+ }
110+ } else {
111+ // local staging repository for JReleaser
112+ maven {
113+ url = uri(layout. buildDirectory. dir(" staging-deploy" ))
114+ }
115+ }
116+ }
117+ }
118+
119+
120+ // https://central.sonatype.org/publish/publish-portal-gradle/
121+ jreleaser {
122+ signing {
123+ setActive(" ALWAYS" )
124+ armored = true
125+ }
126+ deploy {
100127 maven {
101- def releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
102- def snapshotsRepoUrl = " https://central.sonatype.com/repository/maven-snapshots/"
103- url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
104- credentials {
105- username = System . getenv(" MAVEN_USERNAME" )
106- password = System . getenv(" MAVEN_PASSWORD" ) }
128+ mavenCentral {
129+ create(" sonatype" ) {
130+ setActive(" RELEASE" )
131+ username = System . getenv(" MAVEN_USERNAME" )
132+ password = System . getenv(" MAVEN_PASSWORD" )
133+ url = " https://central.sonatype.com/api/v1/publisher"
134+ stagingRepository(" build/staging-deploy" )
135+ setStage(" UPLOAD" ) // OTHERWISE it will do "publish"
136+ }
137+ }
138+ }
139+ }
140+ release {
141+ github {
142+ skipRelease = true
143+ token = " -" // must be not blank
107144 }
108145 }
109146}
Original file line number Diff line number Diff line change 11distributionBase =GRADLE_USER_HOME
22distributionPath =wrapper/dists
3- distributionUrl =https\://services.gradle.org/distributions/gradle-8.0 -bin.zip
3+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.9 -bin.zip
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change 4646
4747
4848 <properties >
49- <sonatypeOssDistMgmtSnapshotsUrl >https://central.sonatype.com/repository/maven-snapshots/</sonatypeOssDistMgmtSnapshotsUrl >
5049 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
5150 </properties >
5251
7271 </execution >
7372 </executions >
7473 </plugin >
74+ <plugin >
75+ <groupId >org.sonatype.central</groupId >
76+ <artifactId >central-publishing-maven-plugin</artifactId >
77+ </plugin >
7578 </plugins >
7679 </build >
7780 </profile >
320323 <snapshotRepository >
321324 <id >sonatype-nexus-snapshots</id >
322325 <name >Sonatype Nexus Snapshots</name >
323- <url >${sonatypeOssDistMgmtSnapshotsUrl} </url >
326+ <url >https://central.sonatype.com/repository/maven-snapshots/ </url >
324327 </snapshotRepository >
325- <repository >
326- <id >sonatype-nexus-staging</id >
327- <name >Nexus Release Repository</name >
328- <url >https://oss.sonatype.org/service/local/staging/deploy/maven2/</url >
329- </repository >
330328 </distributionManagement >
331329 <!-- end of: entries from sonatype oss-parent-->
332330
474472 <artifactId >exec-maven-plugin</artifactId >
475473 <version >1.6.0</version >
476474 </plugin >
475+ <!-- Central publishing -->
476+ <plugin >
477+ <groupId >org.sonatype.central</groupId >
478+ <artifactId >central-publishing-maven-plugin</artifactId >
479+ <version >0.8.0</version >
480+ <extensions >true</extensions >
481+ <configuration >
482+ <publishingServerId >sonatype-nexus-snapshots</publishingServerId >
483+ <autoPublish >false</autoPublish >
484+ </configuration >
485+ </plugin >
477486 </plugins >
478487 </pluginManagement >
479488
You can’t perform that action at this time.
0 commit comments