File tree Expand file tree Collapse file tree 3 files changed +25
-10
lines changed
Expand file tree Collapse file tree 3 files changed +25
-10
lines changed Original file line number Diff line number Diff line change 11name : Publish package to the Maven Central Repository
22on :
3- release :
4- types : [created]
3+ push :
4+ branches :
5+ - release/mavenCentral
56jobs :
67 publish :
78 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -17,3 +17,4 @@ classes/
1717/.settings
1818.classpath
1919.project
20+ .vscode
Original file line number Diff line number Diff line change @@ -9,14 +9,15 @@ plugins {
99 id ' signing'
1010 id ' org.owasp.dependencycheck' version ' 12.1.3'
1111 id ' com.gradleup.shadow' version ' 8.3.7'
12+ id ' org.jreleaser' version ' 1.19.0'
1213}
1314
1415repositories {
1516 mavenCentral()
1617
1718 if (project. hasProperty(" isCI" )) {
1819 maven {
19- url uri(' https://oss .sonatype.org/content/repositories/snapshots/ ' )
20+ url uri(' https://central .sonatype.com/api/v1/publisher ' )
2021 mavenContent {
2122 snapshotsOnly()
2223 }
@@ -160,13 +161,7 @@ publishing {
160161 }
161162 repositories {
162163 maven {
163- credentials {
164- username = System . getenv(" MAVEN_USERNAME" )
165- password = System . getenv(" MAVEN_PASSWORD" )
166- }
167- def releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
168- def snapshotsRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots/'"
169- url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
164+ url = layout. buildDirectory. dir(' staging-deploy' )
170165 }
171166 }
172167}
@@ -179,6 +174,24 @@ signing {
179174 sign publishing. publications. mavenJava
180175}
181176
177+ jreleaser {
178+ signing {
179+ active = ' ALWAYS'
180+ armored = true
181+ }
182+ deploy {
183+ maven {
184+ mavenCentral {
185+ sonatype {
186+ active = ' ALWAYS'
187+ url = ' https://central.sonatype.com/api/v1/publisher'
188+ stagingRepository(' build/staging-deploy' )
189+ }
190+ }
191+ }
192+ }
193+ }
194+
182195wrapper {
183196 gradleVersion = ' 8.14'
184197 distributionType = Wrapper.DistributionType . ALL
You can’t perform that action at this time.
0 commit comments