diff --git a/.github/workflows/maven-java-feature.yml b/.github/workflows/maven-java-feature.yml index 223048e..cd975f5 100644 --- a/.github/workflows/maven-java-feature.yml +++ b/.github/workflows/maven-java-feature.yml @@ -43,6 +43,8 @@ jobs: echo "$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" echo "$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" echo "$(mvn help:evaluate -Dexpression=project.packaging -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" + echo "::set-output name=SONAR_HOST_URL::$(mvn help:evaluate -Dexpression=sonar.host.url -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" + echo "::set-output name=SONAR_PROJECT_KEY::$(mvn help:evaluate -Dexpression=sonar.projectKey -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" env: SERVER_USERNAME: $GITHUB_ACTOR SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} @@ -61,9 +63,17 @@ jobs: env: SERVER_USERNAME: $GITHUB_ACTOR SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} - #TODO - name: Set Leak Period [SonarQube] + #TODO - name: Set Leak Period [SonarCloud.io] #TODO run: checkout du parent commun #TODO run: mvn -U clean verify '-Dmaven.test.failure.ignore=true' #TODO run: mvn -U '-Dsonar.links.scm=http://gitxxx' '-Dsonar.links.ci=http://jenkinsxxx' org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar '-Dsonar.projectKey=[groupId]-[artifactId]' '-Dsonar.branch.name=develop' '-Dsonar.projectName=[artifactId]r' '-Dsonar.buildbreaker.skip=true' '-Dsonar.projectVersion=#d0b75832' - #TODO - name: Quality Gate [SonarQube] + - name: Quality Gate [SonarCloud.io] #TODO run: mvn -U '-Dsonar.links.scm=http://gitxxx' '-Dsonar.links.ci=http://jenkinsxxx' org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar '-Dsonar.projectKey=[groupId]-[artifactId]' '-Dsonar.branch.name=develop' '-Dsonar.projectName=[artifactId]' '-Dsonar.gitlab.ref_name=b7c32ea3401d64f97eecc4dd46de331b00391cd7' '-Dsonar.gitlab.commit_sha=b7c32ea3401d64f97eecc4dd46de331b00391cd7' '-Dsonar.gitlab.project_id=3555' + run: mvn -U -Dsonar.branch.name=${GITHUB_REF#refs/heads/} -Dsonar.gitlab.commit_sha=${GITHUB_SHA} sonar:sonar --file pom.xml --settings .github/workflows/settings.xml + env: + SERVER_USERNAME: $GITHUB_ACTOR + SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Add tags [SonarCloud.io] + run: | + curl -u "${{ secrets.SONAR_TOKEN }}" -X POST "${{ steps.maven-project-info.outputs.SONAR_HOST_URL }}/api/project_tags/set?project=${{ steps.maven-project-info.outputs.SONAR_PROJECT_KEY }}&tags=socle,java" diff --git a/.github/workflows/maven-java.yml b/.github/workflows/maven-java.yml index f1e48f6..a6d72ed 100644 --- a/.github/workflows/maven-java.yml +++ b/.github/workflows/maven-java.yml @@ -72,6 +72,8 @@ jobs: echo "$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" echo "::set-output name=VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" echo "::set-output name=PACKAGING::$(mvn help:evaluate -Dexpression=project.packaging -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" + echo "::set-output name=SONAR_HOST_URL::$(mvn help:evaluate -Dexpression=sonar.host.url -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" + echo "::set-output name=SONAR_PROJECT_KEY::$(mvn help:evaluate -Dexpression=sonar.projectKey -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" env: SERVER_USERNAME: $GITHUB_ACTOR SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} @@ -107,12 +109,20 @@ jobs: env: SERVER_USERNAME: $GITHUB_ACTOR SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} - #TODO - name: Set Leak Period [SonarQube] + #TODO - name: Set Leak Period [SonarCloud.io] #TODO run: checkout du parent commun #TODO run: mvn -U clean verify '-Dmaven.test.failure.ignore=true' #TODO run: mvn -U '-Dsonar.links.scm=http://gitxxx' '-Dsonar.links.ci=http://jenkinsxxx' org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar '-Dsonar.projectKey=[groupId]-[artifactId]' '-Dsonar.branch.name=develop' '-Dsonar.projectName=[artifactId]r' '-Dsonar.buildbreaker.skip=true' '-Dsonar.projectVersion=#d0b75832' - #TODO - name: Quality Gate [SonarQube] + - name: Quality Gate [SonarCloud.io] #TODO run: mvn -U '-Dsonar.links.scm=http://gitxxx' '-Dsonar.links.ci=http://jenkinsxxx' org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar '-Dsonar.projectKey=[groupId]-[artifactId]' '-Dsonar.branch.name=develop' '-Dsonar.projectName=[artifactId]' '-Dsonar.gitlab.ref_name=b7c32ea3401d64f97eecc4dd46de331b00391cd7' '-Dsonar.gitlab.commit_sha=b7c32ea3401d64f97eecc4dd46de331b00391cd7' '-Dsonar.gitlab.project_id=3555' + run: mvn -U -Dsonar.branch.name=${GITHUB_REF#refs/heads/} -Dsonar.gitlab.commit_sha=${GITHUB_SHA} sonar:sonar --file pom.xml --settings .github/workflows/settings.xml + env: + SERVER_USERNAME: $GITHUB_ACTOR + SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Add tags [SonarCloud.io] + run: | + curl -u "${{ secrets.SONAR_TOKEN }}" -X POST "${{ steps.maven-project-info.outputs.SONAR_HOST_URL }}/api/project_tags/set?project=${{ steps.maven-project-info.outputs.SONAR_PROJECT_KEY }}&tags=socle,java" - name: Publish to GitHub Packages Apache Maven run: mvn -U -Dmaven.main.skip -Dunit.test.skip -Dverify.skip jar:jar@default-jar assembly:single@make-assembly source:jar-no-fork@attach-sources javadoc:jar@attach-javadocs deploy --file pom.xml --settings .github/workflows/settings.xml env: diff --git a/.github/workflows/settings.xml b/.github/workflows/settings.xml index e1dbe0d..273b971 100644 --- a/.github/workflows/settings.xml +++ b/.github/workflows/settings.xml @@ -45,7 +45,9 @@ - + + org.sonarsource.scanner.maven + diff --git a/.travis.yml b/.travis.yml index 0c1e754..4497448 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,7 @@ jobs: - mvn -U clean compile -Pproject-controls-check --file pom.xml --settings .github/workflows/settings.xml - mvn -U -Dmaven.main.skip test --file pom.xml --settings .github/workflows/settings.xml - mvn -U -Dmaven.main.skip -Dunit.test.skip verify --file pom.xml --settings .github/workflows/settings.xml + - mvn -U -Dsonar.branch.name=${GITHUB_REF#refs/heads/} -Dsonar.gitlab.commit_sha=${GITHUB_SHA} sonar:sonar --file pom.xml --settings .github/workflows/settings.xml - stage: Deploy and make Site name: Publish to GitHub Packages Apache Maven diff --git a/README.md b/README.md index cfde026..179df41 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ![Maven CI for Java](https://github.com/bdelion/java-parent/workflows/Maven%20CI%20for%20Java/badge.svg?branch=develop) [![Travis CI Build Status](https://travis-ci.com/bdelion/java-parent.svg?branch=develop)](https://travis-ci.com/bdelion/java-parent) -[![Known Vulnerabilities](https://snyk.io/test/github/bdelion/java-parent/badge.svg?targetFile=pom.xml)](https://snyk.io/test/github/bdelion/java-parent?targetFile=pom.xml) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?branch=develop&project=fr.fifiz.socle.java%3Ajava-parent&metric=alert_status)](https://sonarcloud.io/dashboard?id=fr.fifiz.socle.java%3Ajava-parent&branch=develop) [![Known Vulnerabilities](https://snyk.io/test/github/bdelion/java-parent/badge.svg?targetFile=pom.xml)](https://snyk.io/test/github/bdelion/java-parent?targetFile=pom.xml)

Sourcerer gitMemory diff --git a/pom.xml b/pom.xml index 18adaf9..1029532 100644 --- a/pom.xml +++ b/pom.xml @@ -108,8 +108,8 @@ UTF-8 true true - false - false + true + true 3.2.0 3.2.0 @@ -122,19 +122,28 @@ 5.6.2 3.0.0-M4 + ${project.build.directory}/surefire-reports 3.0.0-M4 0.8.5 ${project.build.directory}/coverage-reports/jacoco-ut.exec ${project.build.directory}/coverage-reports/jacoco-it.exec - true 3.9.0 3.0.0 2.3 + + 3.7.0.1746 + https://sonarcloud.io + bdelion-github + ${project.groupId}:${project.artifactId} + ${project.name} + ${project.version} + ${project.build.sourceEncoding} + + ${surefire.reportsDirectory} + ${project.reporting.outputDirectory}/jacoco-it/jacoco.xml,${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml,${project.reporting.outputDirectory}/jacoco-aggregate/jacoco.xml @@ -326,6 +335,7 @@ maven-surefire-plugin ${maven-surefire-plugin.version} + ${surefire.reportsDirectory} false alphabetical @@ -547,6 +557,12 @@ maven-project-info-reports-plugin ${maven-project-info-reports-plugin} + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${sonar-maven-plugin.version} +