File tree Expand file tree Collapse file tree 3 files changed +14
-15
lines changed
.github/actions/maven-publish Expand file tree Collapse file tree 3 files changed +14
-15
lines changed Original file line number Diff line number Diff line change 3535
3636 - name : Publish Java Packages to Maven
3737 shell : bash
38- run : ./gradlew publish -PisSnapshot=false --stacktrace
38+ run : ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -PisSnapshot=false --stacktrace
3939 env :
4040 JAVA_HOME : ${{ env.JAVA_HOME }}
4141 MAVEN_USERNAME : ${{ inputs.ossr-username }}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ plugins {
1313 id ' java'
1414 id ' jacoco'
1515 id ' me.champeau.gradle.japicmp' version ' 0.2.9'
16+ id ' io.github.gradle-nexus.publish-plugin' version ' 2.0.0'
1617}
1718
1819jacoco {
Original file line number Diff line number Diff line change @@ -26,21 +26,18 @@ artifacts {
2626}
2727
2828
29- final releaseRepositoryUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
30- final snapshotRepositoryUrl = " https://oss.sonatype.org/content/repositories/snapshots/"
31-
3229publishing {
3330 publications {
3431 mavenJava(MavenPublication ) {
32+ from components. java
33+
34+ artifact sourcesJar
35+ artifact javadocJar
3536
3637 groupId = GROUP
3738 artifactId = POM_ARTIFACT_ID
3839 version = getVersionName()
3940
40- artifact(" $buildDir /libs/${ project.name} -${ version} .jar" )
41- artifact sourcesJar
42- artifact javadocJar
43-
4441 pom {
4542 name = POM_NAME
4643 packaging = POM_PACKAGING
@@ -82,14 +79,15 @@ publishing {
8279 }
8380 }
8481 }
82+ }
83+
84+ nexusPublishing {
8585 repositories {
86- maven {
87- name = " sonatype"
88- url = version. endsWith(' SNAPSHOT' ) ? snapshotRepositoryUrl : releaseRepositoryUrl
89- credentials {
90- username = System . getenv(" MAVEN_USERNAME" )
91- password = System . getenv(" MAVEN_PASSWORD" )
92- }
86+ sonatype {
87+ nexusUrl. set(uri(' https://ossrh-staging-api.central.sonatype.com/service/local/' ))
88+ snapshotRepositoryUrl. set(uri(' https://central.sonatype.com/repository/maven-snapshots/' ))
89+ username. set(System . getenv(" MAVEN_USERNAME" ))
90+ password. set(System . getenv(" MAVEN_PASSWORD" ))
9391 }
9492 }
9593}
You can’t perform that action at this time.
0 commit comments