Skip to content

Commit

Permalink
add sonar properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Maboh Christopher committed Sep 25, 2024
1 parent 8ad1642 commit 3817e0c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/unit-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
- name: SonarQube analysis
run: |
mvn -ntp -s settings.xml ${RUNNER_DEBUG:+"--debug"} package sonar:sonar -Dsonar.projectKey=ab2d-project -Dsonar.qualitygate.wait=true -DskipTests -Dusername=${ARTIFACTORY_USER} -Dpassword=${ARTIFACTORY_PASSWORD} -Drepository_url=${ARTIFACTORY_URL} -Pcoverage
mvn -ntp -s settings.xml ${RUNNER_DEBUG:+"--debug"} package sonar:sonar -Pcoverage -Dsonar.projectKey=ab2d-project -Dsonar.qualitygate.wait=true -DskipTests -Dusername=${ARTIFACTORY_USER} -Dpassword=${ARTIFACTORY_PASSWORD} -Drepository_url=${ARTIFACTORY_URL} -Dsonar.jacoco.reportPaths="api/target/site/jacoco/jacoco.xml,common/target/site/jacoco/jacoco.xml,coverage/target/site/jacoco/jacoco.xml,e2e-bfd-test/target/site/jacoco/jacoco.xml,e2e-test/target/site/jacoco/jacoco.xml,job/target/site/jacoco/jacoco.xml,worker/target/site/jacoco/jacoco.xml" \
- name: Run unit and integration tests
run: |
mvn -ntp -s settings.xml ${RUNNER_DEBUG:+"--debug"} -Dusername=${ARTIFACTORY_USER} -Dpassword=${ARTIFACTORY_PASSWORD} -Drepository_url=${ARTIFACTORY_URL} test -pl common,job,coverage,api,worker -Pcoverage
mvn -ntp -s settings.xml ${RUNNER_DEBUG:+"--debug"} -Dusername=${ARTIFACTORY_USER} -Dpassword=${ARTIFACTORY_PASSWORD} -Drepository_url=${ARTIFACTORY_URL} test -pl common,job,coverage,api,worker
16 changes: 13 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@
<sonar.projectName>AB2D</sonar.projectName>
<sonar.projectVersion>0.0.1-SNAPSHOT</sonar.projectVersion>
<sonar.language>java</sonar.language>
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.jacoco.reportPaths>api/target/jacoco.exec,common/target/jacoco.exec,coverage/target/jacoco.exec,e2e-bfd-test/target/jacoco.exec,e2e-test/target/jacoco.exec,job/target/jacoco.exec,worker/target/jacoco.exec</sonar.jacoco.reportPaths>
<sonar.junit.reportPaths>target/surefire-reports,target/surefire-reports,target/surefire-reports,target/surefire-reports,target/surefire-reports,target/surefire-reports,target/surefire-reports</sonar.junit.reportPaths>
<sonar.jacoco.reportPaths>api/target/site/jacoco/jacoco.xml,common/target/site/jacoco/jacoco.xml,coverage/target/site/jacoco/jacoco.xml,e2e-bfd-test/target/site/jacoco/jacoco.xml,e2e-test/target/site/jacoco/jacoco.xml,job/target/site/jacoco/jacoco.xml,worker/target/site/jacoco/jacoco.xml</sonar.jacoco.reportPaths>

</properties>
Expand Down Expand Up @@ -95,6 +94,16 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>4.0.0.4121</version> <!-- Update to the latest version if necessary -->
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>coverage</id>
Expand Down Expand Up @@ -128,16 +137,17 @@
<version>${jacoco.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<phase>test</phase>
</execution>
<execution>
<id>jacoco-check</id>
Expand Down

0 comments on commit 3817e0c

Please sign in to comment.