11name : Java CI/CD
22
3- on : [push, pull_request]
3+ on :
4+ push :
5+ branches :
6+ - master
7+ pull_request :
8+ types : [opened, synchronize, reopened]
49
510jobs :
611 build :
1419 with :
1520 distribution : ' temurin'
1621 java-version : 21
17- server-id : ossrh # Value of the distributionManagement/repository/id field of the pom.xml
22+ # generate settings.xml with the correct values
23+ server-id : sonatype-central-portal # Value of the distributionManagement/repository/id field of the pom.xml
1824 server-username : MAVEN_USERNAME # env variable for username in deploy
1925 server-password : MAVEN_PASSWORD # env variable for token in deploy
2026 - name : Adjust Git Config
2329 git config --global user.name "GitHub Action"
2430 - name : Build and Analyse Reactor with Maven
2531 if : github.ref != 'refs/heads/master'
26- run : ./mvnw -B clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Netcentric_aem-classification -Dsonar.organization=netcentric -Dsonar.host.url=https://sonarcloud.io -Pcoverage-report
32+ run : ./mvnw -B clean install org.sonarsource.scanner.maven:sonar-maven-plugin:5.2.0.4988: sonar -Dsonar.projectKey=Netcentric_aem-classification -Dsonar.organization=netcentric -Dsonar.host.url=https://sonarcloud.io -Dsonar.scanner.skipJreProvisioning=true -Pcoverage-report
2733 env :
2834 # SonarCloud access token should be generated from https://sonarcloud.io/account/security/
2935 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
@@ -34,10 +40,10 @@ jobs:
3440 run : ./mvnw -B clean site --file aem-classification-maven-plugin/pom.xml
3541 - name : Build, Analyse and Deploy Reactor with Maven
3642 if : github.ref == 'refs/heads/master'
37- run : ./mvnw -B clean deploy org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Netcentric_aem-classification -Dsonar.organization=netcentric -Dsonar.host.url=https://sonarcloud.io -Pcoverage-report
43+ run : ./mvnw -B clean deploy org.sonarsource.scanner.maven:sonar-maven-plugin:5.2.0.4988: sonar -Dsonar.projectKey=Netcentric_aem-classification -Dsonar.organization=netcentric -Dsonar.host.url=https://sonarcloud.io -Dsonar.scanner.skipJreProvisioning=true - Pcoverage-report -DaltDeploymentRepository=id::njord:snapshot
3844 env :
39- MAVEN_USERNAME : ${{ secrets.OSSRH_TOKEN_USER }}
40- MAVEN_PASSWORD : ${{ secrets.OSSRH_TOKEN_PASSWORD }}
45+ MAVEN_USERNAME : ${{ secrets.SONATYPE_CENTRAL_TOKEN_USER }}
46+ MAVEN_PASSWORD : ${{ secrets.SONATYPE_CENTRAL_TOKEN_PASSWORD }}
4147 # SonarCloud access token should be generated from https://sonarcloud.io/account/security/
4248 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
4349 # Needed to get some information about the pull request, if any
0 commit comments