Skip to content

Commit 62d2558

Browse files
fix: sonar
1 parent b635ca2 commit 62d2558

File tree

2 files changed

+51
-43
lines changed

2 files changed

+51
-43
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,23 @@ jobs:
3232
key: ${{ runner.os }}-sonar
3333
restore-keys: ${{ runner.os }}-sonar
3434

35-
- name: Build and test (generate JaCoCo)
36-
run: mvn -B -DskipTests=false verify
35+
# - name: Build and test (generate JaCoCo)
36+
# run: mvn -B verify -Djacoco.skip=false
37+
38+
# - name: Generate combined report
39+
# run: |
40+
# mkdir -p target/jacoco-merged
41+
# cp domain/target/jacoco.exec target/jacoco-merged/domain.exec
42+
# cp infrastructure/target/jacoco.exec target/jacoco-merged/infra.exec
43+
# mvn jacoco:merge -DfileSets=target/jacoco-merged
3744

3845
- name: SonarCloud analyze (push) - non-blocking
3946
if: github.event_name != 'pull_request'
4047
env:
4148
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4249
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4350
run: >-
44-
mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
51+
cd domain && mvn verify && mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
4552
-Dsonar.host.url=https://sonarcloud.io
4653
-Dsonar.organization=${{ vars.SONAR_ORG }}
4754
-Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }}
@@ -54,7 +61,7 @@ jobs:
5461
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5562
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
5663
run: >-
57-
mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
64+
cd domain && mvn verify && mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
5865
-Dsonar.host.url=https://sonarcloud.io
5966
-Dsonar.organization=${{ vars.SONAR_ORG }}
6067
-Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }}

pom.xml

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@
3131
</properties>
3232

3333
<build>
34-
<pluginManagement>
35-
<plugins>
36-
<plugin>
37-
<groupId>org.jacoco</groupId>
38-
<artifactId>jacoco-maven-plugin</artifactId>
39-
<version>0.8.12</version>
40-
</plugin>
41-
</plugins>
42-
</pluginManagement>
4334
<plugins>
4435
<plugin>
4536
<groupId>org.sonarsource.scanner.maven</groupId>
@@ -49,40 +40,50 @@
4940
<plugin>
5041
<groupId>org.apache.maven.plugins</groupId>
5142
<artifactId>maven-surefire-plugin</artifactId>
52-
<version>3.5.2</version>
43+
<version>3.5.3</version>
44+
</plugin>
45+
<plugin>
46+
<groupId>org.jacoco</groupId>
47+
<artifactId>jacoco-maven-plugin</artifactId>
48+
<version>0.8.13</version>
49+
<executions>
50+
<execution>
51+
<id>default-prepare-agent</id>
52+
<goals>
53+
<goal>prepare-agent</goal>
54+
</goals>
55+
</execution>
56+
<execution>
57+
<id>default-report</id>
58+
<goals>
59+
<goal>report</goal>
60+
</goals>
61+
</execution>
62+
<execution>
63+
<id>default-check</id>
64+
<goals>
65+
<goal>check</goal>
66+
</goals>
67+
<configuration>
68+
<rules>
69+
<rule>
70+
<element>BUNDLE</element>
71+
<limits>
72+
<limit>
73+
<counter>COMPLEXITY</counter>
74+
<value>COVEREDRATIO</value>
75+
<minimum>0.60</minimum>
76+
</limit>
77+
</limits>
78+
</rule>
79+
</rules>
80+
</configuration>
81+
</execution>
82+
</executions>
5383
</plugin>
5484
</plugins>
5585
</build>
5686

57-
<profiles>
58-
<profile>
59-
<id>coverage</id>
60-
<build>
61-
<plugins>
62-
<plugin>
63-
<groupId>org.jacoco</groupId>
64-
<artifactId>jacoco-maven-plugin</artifactId>
65-
<executions>
66-
<execution>
67-
<id>prepare-agent</id>
68-
<goals>
69-
<goal>prepare-agent</goal>
70-
</goals>
71-
</execution>
72-
<execution>
73-
<id>report</id>
74-
<phase>prepare-package</phase>
75-
<goals>
76-
<goal>report</goal>
77-
</goals>
78-
</execution>
79-
</executions>
80-
</plugin>
81-
</plugins>
82-
</build>
83-
</profile>
84-
</profiles>
85-
8687
<dependencyManagement>
8788
<dependencies>
8889
<dependency>

0 commit comments

Comments
 (0)