Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/maven-java-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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"
14 changes: 12 additions & 2 deletions .github/workflows/maven-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
</server>
</servers>

<pluginGroups></pluginGroups>
<pluginGroups>
<pluginGroup>org.sonarsource.scanner.maven</pluginGroup>
</pluginGroups>
<proxies></proxies>
<mirrors></mirrors>
</settings>
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<p>
<a href="https://sourcerer.io/bdelion"><img src="https://sourcerer.io/icons/logo-sharing.svg" height="24px" alt="Sourcerer"></a> <a href="https://www.gitmemory.com/bdelion"><img src="https://www.gitmemory.com/images/logo.png" height="24px" alt="gitMemory"></a>
Expand Down
26 changes: 21 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.optimize>true</maven.compiler.optimize>
<maven.compiler.debug>true</maven.compiler.debug>
<maven.compiler.showDeprecation>false</maven.compiler.showDeprecation>
<maven.compiler.showWarnings>false</maven.compiler.showWarnings>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
<maven.compiler.showWarnings>true</maven.compiler.showWarnings>
<!-- END - maven.compiler properties -->
<maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
<maven-assembly-plugin.version>3.2.0</maven-assembly-plugin.version>
Expand All @@ -122,19 +122,28 @@
<!-- Tests -->
<junit.version>5.6.2</junit.version>
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
<surefire.reportsDirectory>${project.build.directory}/surefire-reports</surefire.reportsDirectory>
<maven-failsafe-plugin.version>3.0.0-M4</maven-failsafe-plugin.version>
<jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
<jacoco.utReportPath>${project.build.directory}/coverage-reports/jacoco-ut.exec</jacoco.utReportPath>
<jacoco.itReportPath>${project.build.directory}/coverage-reports/jacoco-it.exec</jacoco.itReportPath>
<!-- FIXME https://bcouetil.gitlab.io/academy/BP-maven.html#sonarqube-with-jacoco-for-coverage
<sonar.jacoco.reportPaths>${jacoco.utReportPath}, ${jacoco.itReportPath}</sonar.jacoco.reportPaths>
-->
<!-- Assembly -->
<maven-assembly-plugin-skip>true</maven-assembly-plugin-skip>
<!-- Site and Report generation -->
<maven-site-plugin.version>3.9.0</maven-site-plugin.version>
<maven-jxr-plugin.version>3.0.0</maven-jxr-plugin.version>
<maven-changelog-plugin.version>2.3</maven-changelog-plugin.version>
<!-- Code Quality -->
<sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>bdelion-github</sonar.organization>
<sonar.projectKey>${project.groupId}:${project.artifactId}</sonar.projectKey>
<sonar.projectName>${project.name}</sonar.projectName>
<sonar.projectVersion>${project.version}</sonar.projectVersion>
<sonar.sourceEncoding>${project.build.sourceEncoding}</sonar.sourceEncoding>
<!-- FIXME https://bcouetil.gitlab.io/academy/BP-maven.html#sonarqube-with-jacoco-for-coverage -->
<sonar.junit.reportPaths>${surefire.reportsDirectory}</sonar.junit.reportPaths>
<sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-it/jacoco.xml,${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml,${project.reporting.outputDirectory}/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -326,6 +335,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<reportsDirectory>${surefire.reportsDirectory}</reportsDirectory>
<testFailureIgnore>false</testFailureIgnore>
<runOrder>alphabetical</runOrder>
<!-- Sets the VM argument line used when unit tests are run. -->
Expand Down Expand Up @@ -547,6 +557,12 @@
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>${maven-project-info-reports-plugin}</version>
</plugin>
<!-- Trigger SonarQube analysis on Maven projects -->
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin.version}</version>
</plugin>
</plugins>
</build>

Expand Down