File tree Expand file tree Collapse file tree 3 files changed +27
-38
lines changed Expand file tree Collapse file tree 3 files changed +27
-38
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,12 @@ jobs:
4848      - uses : gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2  #  v5.0.0
4949      - name : Publish to Maven Central 
5050        run : | 
51-           ./gradlew publishAllPublicationsToStagingRepository 
52-           ./gradlew jreleaserDeploy --stacktrace 
51+           ./gradlew publishAggregationToCentralPortal 
5352env :
5453          ORG_GRADLE_PROJECT_signingKey : ${{ secrets.OSSRH_GPG_SECRET_KEY }} 
5554          ORG_GRADLE_PROJECT_signingPassword : ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} 
56-           JRELEASER_MAVENCENTRAL_USERNAME : ${{ secrets.MAVENCENTRAL_USERNAME }} 
57-           JRELEASER_MAVENCENTRAL_PASSWORD : ${{ secrets.MAVENCENTRAL_PASSWORD }} 
55+           ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.MAVENCENTRAL_USERNAME }} 
56+           ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.MAVENCENTRAL_PASSWORD }} 
5857
5958  docker-build-push :
6059    name : Push Docker image 
Original file line number Diff line number Diff line change 77plugins  {
88    id " com.github.ben-manes.versions" " 0.53.0" 
99    id " com.diffplug.spotless" " 8.0.0" 
10+     id " com.gradleup.nmcp.aggregation" " 1.2.0" 
11+     id " com.gradleup.nmcp" " 1.2.0" false 
1012}
1113
1214version =  ' 2.5.8' 
@@ -22,6 +24,18 @@ if (properties.containsKey('NIGHTLY')) {
2224    ext. nightly =  false 
2325}
2426
27+ nmcpAggregation  {
28+     centralPortal {
29+         username =  findProperty(' mavenCentralUsername' 
30+         password =  findProperty(' mavenCentralPassword' 
31+         publishingType =  " AUTOMATIC" 
32+     }
33+ }
34+ 
35+ dependencies  {
36+     nmcpAggregation(project(' fabric-chaincode-shim' 
37+ }
38+ 
2539allprojects  {
2640    apply plugin : " com.diffplug.spotless" 
2741
Original file line number Diff line number Diff line change 77plugins  {
88    id ' maven-publish' 
99    id ' signing' 
10-     id ' org.jreleaser' ' 1.20.0' 
1110    id ' jacoco' 
1211    id ' pmd' 
12+     id " com.gradleup.nmcp" 
1313}
1414
1515pmd  {
@@ -224,8 +224,8 @@ javadoc {
224224def  final  stagingDeployUrl =  layout. buildDirectory. dir(' staging-deploy' 
225225
226226publishing  {
227-       publications {
228-           shim(MavenPublication ) {
227+     publications {
228+         shim(MavenPublication ) {
229229            groupId =  project. group
230230            artifactId =  project. name
231231            version =  project. version
@@ -261,16 +261,10 @@ publishing {
261261                    }
262262                }
263263            }
264-          }
265- 
266-      }
267- 
268-     repositories {
269-         maven {
270-             name =  " Staging" 
271-             url =  stagingDeployUrl
272264        }
265+     }
273266
267+     repositories {
274268        maven {
275269            name =  " GitHub" 
276270            url =  " https://maven.pkg.github.com/hyperledger/fabric-chaincode-java" 
@@ -283,34 +277,16 @@ publishing {
283277}
284278
285279signing  {
286-     required =  { gradle. taskGraph. hasTask(" :${ project.name} " 
287- 
288280    def  signingKey =  findProperty(' signingKey' 
289281    def  signingPassword =  findProperty(' signingPassword' 
290282    useInMemoryPgpKeys(signingKey, signingPassword)
291283
292-     sign publishing. publications. shim
293- }
294- 
295- jreleaser  {
296-     gitRootSearch =  true 
297-     deploy {
298-         maven {
299-             mavenCentral {
300-                 sonatype {
301-                     active =  ' ALWAYS' 
302-                     url =  ' https://central.sonatype.com/api/v1/publisher' 
303-                     sign =  false 
304-                     stagingRepository(file(stagingDeployUrl). toString())
305-                 }
306-             }
307-         }
308-     }
309-     release {
310-         github {
311-             enabled =  false 
312-         }
284+     required =  {
285+         gradle. taskGraph. hasTask(" :${ project.name} " 
286+             ||  gradle. taskGraph. hasTask(" :${ project.name} " 
313287    }
288+ 
289+     sign publishing. publications. shim
314290}
315291
316292//  Need to specify the sourcesJar task BEFORE the java{withSourcesJar()} so that it picks up the duplicatesStratergy
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments