Skip to content

Commit

Permalink
- Improve Sonar
Browse files Browse the repository at this point in the history
- Bugfixes dies das
  • Loading branch information
MichiBaum committed Oct 9, 2024
1 parent 849bc63 commit 56d4587
Show file tree
Hide file tree
Showing 15 changed files with 162 additions and 24 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 verify -fn -Psonar-report
mvn sonar:sonar -Psonar-report -Dsonar.projectKey=MichiBaum_Microservices
5 changes: 3 additions & 2 deletions admin-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@
</profiles>

<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
Expand Down
5 changes: 5 additions & 0 deletions authentication-library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,9 @@

</dependencies>

<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<!-- <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>-->
</build>

</project>
6 changes: 3 additions & 3 deletions authentication-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@
</profiles>

<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<testSourceDirectory>src/test/kotlin</testSourceDirectory>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
Expand Down
6 changes: 4 additions & 2 deletions chess-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<artifactId>microservice</artifactId>
<groupId>com.michibaum</groupId>
<version>1.0.0-TEST-9</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>chess-service</artifactId>
Expand Down Expand Up @@ -141,10 +142,11 @@
</profiles>

<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PersonRepositoryIT {
assertNotEquals(playerWithAccount.id, result.id)

assertEquals(1, result.accounts.size)
assertEquals(savedAccount.id, result.accounts[0].id)
assertEquals(savedAccount.id, result.accounts.get(0).id)
}

}
5 changes: 3 additions & 2 deletions gateway-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,11 @@
</profiles>

<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
Expand Down
5 changes: 3 additions & 2 deletions javadoc-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@
</profiles>

<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
Expand Down
5 changes: 5 additions & 0 deletions permission-library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@
<dependencies>
</dependencies>

<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<!-- <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>-->
</build>

</project>
123 changes: 119 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 @@ -66,6 +62,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-bom</artifactId>
<version>${kotlin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -144,7 +147,49 @@
<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>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.language>kotlin</sonar.language>
</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>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -183,6 +228,7 @@
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<jvmTarget>${java.version}</jvmTarget>
<args>
Expand All @@ -208,6 +254,75 @@
<version>${kotlin.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal> <!-- You can skip the <goals> element if you enable extensions for the plugin -->
</goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
<sourceDir>${project.basedir}/src/main/java</sourceDir>
</sourceDirs>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<goals>
<goal>test-compile</goal> <!-- You can skip the <goals> element if you enable extensions for the plugin -->
</goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
<sourceDir>${project.basedir}/src/test/java</sourceDir>
</sourceDirs>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
@{argLine} --illegal-access=permit
</argLine>
<testSourceDirectory>
${project.basedir}/src/test/kotlin
</testSourceDirectory>
<includes>
<include>**/*UT.java</include>
<include>**/*UT.kt</include>
<include>**/*UT.class</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>
<argLine>
@{argLine} --illegal-access=permit
</argLine>
<testSourceDirectory>
${project.basedir}/src/test/kotlin
</testSourceDirectory>
<includes>
<include>**/*IT.java</include>
<include>**/*IT.kt</include>
<include>**/*IT.class</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
5 changes: 3 additions & 2 deletions registry-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@
</profiles>

<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
Expand Down
5 changes: 5 additions & 0 deletions usermanagement-library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@

</dependencies>

<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<!-- <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>-->
</build>

</project>
5 changes: 3 additions & 2 deletions usermanagement-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,11 @@
</profiles>

<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
Expand Down
5 changes: 3 additions & 2 deletions website-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@
</profiles>

<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<!-- <exclude>**/*.woff2</exclude>-->
Expand Down

0 comments on commit 56d4587

Please sign in to comment.