Skip to content

Commit

Permalink
added profile for sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
MichiBaum committed Oct 8, 2024
1 parent 849bc63 commit d549a47
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn clean compile
mvn sonar:sonar -Dsonar.projectKey=MichiBaum_Microservices
mvn clean compile -Psonar-report
mvn sonar:sonar -Psonar-report -Dsonar.projectKey=MichiBaum_Microservices
69 changes: 65 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@

<!-- Docker Hub -->
<dockerHub.url>https://registry.hub.docker.com</dockerHub.url>

<!-- Sonarqube -->
<sonar.organization>michibaum</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>

<dependencies>
Expand Down Expand Up @@ -144,6 +140,44 @@
<module>chess-service</module>
</modules>

<profiles>
<profile>
<id>sonar-report</id>
<properties>
<sonar.organization>michibaum</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<formats>
<format>XML</format>
</formats>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -209,6 +243,33 @@
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*UT.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit d549a47

Please sign in to comment.