53
53
<strongbox .host>localhost</strongbox .host>
54
54
<strongbox .port>48080</strongbox .port>
55
55
56
+ <!-- Sonar: -->
57
+ <sonar .language>java</sonar .language>
58
+ <sonar .java.coveragePlugin>jacoco</sonar .java.coveragePlugin>
59
+ <sonar .coverage.jacoco.xmlReportPaths>target/jacoco-merged/jacoco-merged-report/jacoco.xml</sonar .coverage.jacoco.xmlReportPaths>
60
+ <sonar .exclusions>**/*Test.java,**/*TestIT.java,**/*Exception.java,**/InMemoryOrientDbConfig.java</sonar .exclusions>
61
+ <!-- Sonar. -->
62
+
56
63
<!-- Version properties: -->
57
64
<version .maven.indexer>6.0.1-SNAPSHOT</version .maven.indexer>
58
65
98
105
<version .awaitility>4.0.1</version .awaitility>
99
106
<version .asm>6.0</version .asm>
100
107
<version .jtwig>5.87.0.RELEASE</version .jtwig>
101
- <version .jacoco>0.8.2</version .jacoco>
108
+ <version .jacoco>0.8.4</version .jacoco>
109
+ <version .sonar-maven-plugin>3.7.0.1746</version .sonar-maven-plugin>
102
110
<version .codacy.mvn.plugin>1.1.0</version .codacy.mvn.plugin>
103
111
<version .semver>0.9.34-SNAPSHOT</version .semver>
104
112
<version .springfox>2.9.2</version .springfox>
162
170
<inherited >true</inherited >
163
171
<configuration >
164
172
<useSystemClassLoader >false</useSystemClassLoader >
165
- <argLine >-Xmx1024m -Xms512m ${surefireArgLine} </argLine >
173
+ <!-- Use @{} (late property evaluation) instead of ${} or jacoco will not write the exec file! -->
174
+ <argLine >@{surefireArgLine} -Xmx1024m -Xms512m</argLine >
166
175
<includes >
167
176
<include >**/*Test</include >
168
177
</includes >
169
178
<excludes >
170
179
<exclude >**/*TestIT</exclude >
171
180
</excludes >
172
181
173
- <!-- This field needs to be set to 1 or jacoco reports will be incorrect/missing! -->
174
- <forkCount >1</forkCount >
175
-
176
182
<systemPropertyVariables >
177
183
<strongbox .home>${project.build.directory} /strongbox</strongbox .home>
178
184
<strongbox .vault>${project.build.directory} /strongbox-vault</strongbox .vault>
187
193
<strongbox .nuget.download.feed>false</strongbox .nuget.download.feed>
188
194
<strongbox .download.indexes>false</strongbox .download.indexes>
189
195
</systemPropertyVariables >
190
-
191
- <properties >
192
- <property >
193
- <name >listener</name >
194
- <value >org.sonar.java.jacoco.JUnitListener</value >
195
- </property >
196
- </properties >
197
196
</configuration >
198
197
</plugin >
199
198
<plugin >
203
202
204
203
<configuration >
205
204
<useSystemClassLoader >false</useSystemClassLoader >
206
- <argLine >${failsafeArgLine} </argLine >
205
+ <!-- Use @{} (late property evaluation) instead of ${} or jacoco will not write the exec file! -->
206
+ <argLine >@{failsafeArgLine}</argLine >
207
207
<systemPropertyVariables >
208
208
<strongbox .home>${project.build.directory} /strongbox</strongbox .home>
209
209
<strongbox .vault>${project.build.directory} /strongbox-vault</strongbox .vault>
239
239
<artifactId >strongbox-common-resources</artifactId >
240
240
<version >${project.version} </version >
241
241
<type >jar</type >
242
-
242
+
243
243
<overWrite >true</overWrite >
244
244
<outputDirectory >${strongbox.home} /etc</outputDirectory >
245
245
<includes >logback*xml</includes >
249
249
<artifactId >strongbox-storage-api-resources</artifactId >
250
250
<version >${project.version} </version >
251
251
<type >jar</type >
252
-
252
+
253
253
<overWrite >true</overWrite >
254
254
<outputDirectory >${strongbox.home} </outputDirectory >
255
255
<includes >etc/conf/strongbox.yaml</includes >
259
259
<artifactId >strongbox-common-resources</artifactId >
260
260
<version >${project.version} </version >
261
261
<type >jar</type >
262
-
262
+
263
263
<overWrite >true</overWrite >
264
264
<outputDirectory >${strongbox.home} </outputDirectory >
265
265
<includes >etc/**</includes >
285
285
<goals >deploy -DaltDeploymentRepository=${serverId} ::default::${deployUrl} </goals >
286
286
</configuration >
287
287
</plugin >
288
-
288
+
289
289
<plugin >
290
290
<groupId >org.codehaus.mojo</groupId >
291
291
<artifactId >build-helper-maven-plugin</artifactId >
1389
1389
<build >
1390
1390
<pluginManagement >
1391
1391
<plugins >
1392
+ <plugin >
1393
+ <groupId >org.sonarsource.scanner.maven</groupId >
1394
+ <artifactId >sonar-maven-plugin</artifactId >
1395
+ <version >${version.sonar-maven-plugin} </version >
1396
+ </plugin >
1392
1397
<plugin >
1393
1398
<groupId >org.jacoco</groupId >
1394
1399
<artifactId >jacoco-maven-plugin</artifactId >
@@ -1400,130 +1405,124 @@
1400
1405
<plugin >
1401
1406
<groupId >org.jacoco</groupId >
1402
1407
<artifactId >jacoco-maven-plugin</artifactId >
1408
+ <version >${version.jacoco} </version >
1409
+ <inherited >true</inherited >
1403
1410
<configuration >
1404
1411
<append >true</append >
1412
+ <includes >
1413
+ <include >org/carlspring/**</include >
1414
+ </includes >
1415
+ <excludes >
1416
+ <exclude >org/carlspring/strongbox/app/*</exclude >
1417
+ <exclude >org/carlspring/strongbox/config/*</exclude >
1418
+ <exclude >org/carlspring/strongbox/data/server/InMemoryOrientDbServer.class</exclude >
1419
+ <exclude >com/orientechnologies/*</exclude >
1420
+ <exclude >org/orientechnologies/*</exclude >
1421
+ <exclude >org/springframework/*</exclude >
1422
+ <exclude >com/hazelcast/*</exclude >
1423
+ <exclude >*Test.java</exclude >
1424
+ <exclude >*TestIT.java</exclude >
1425
+ <exclude >*Exception.java</exclude >
1426
+ </excludes >
1405
1427
</configuration >
1406
1428
<executions >
1407
- <!--
1408
- Prepares the property pointing to the JaCoCo runtime agent which
1409
- is passed as VM argument when Maven the Surefire plugin is executed.
1410
- -->
1411
1429
<execution >
1412
- <id >pre -unit-test</id >
1430
+ <id >prepare -unit-test-agent </id >
1413
1431
<goals >
1414
1432
<goal >prepare-agent</goal >
1415
1433
</goals >
1416
1434
<configuration >
1417
- <!-- Sets the path to the file which contains the execution data. -->
1418
- <destFile >${project.build.directory} /jacoco-ut.exec</destFile >
1419
- <!--
1420
- Sets the name of the property containing the settings
1421
- for JaCoCo runtime agent.
1422
- -->
1435
+ <destFile >${project.build.directory} /jacoco/jacoco-ut.exec</destFile >
1423
1436
<propertyName >surefireArgLine</propertyName >
1424
1437
</configuration >
1425
1438
</execution >
1426
-
1427
-
1428
- <!--
1429
- Prepares the property pointing to the JaCoCo runtime agent which
1430
- is passed as VM argument when Maven the Failsafe plugin is executed.
1431
- -->
1432
1439
<execution >
1433
- <id >pre-integration-test</id >
1434
- <phase >pre-integration-test</phase >
1440
+ <id >prepare-integration-test-agent</id >
1435
1441
<goals >
1436
- <goal >prepare-agent</goal >
1442
+ <goal >prepare-agent-integration </goal >
1437
1443
</goals >
1444
+ <phase >pre-integration-test</phase >
1438
1445
<configuration >
1439
- <!-- Sets the path to the file which contains the execution data. -->
1440
- <destFile >${project.build.directory} /jacoco-it.exec</destFile >
1441
- <!--
1442
- Sets the name of the property containing the settings
1443
- for JaCoCo runtime agent.
1444
- -->
1446
+ <destFile >${project.build.directory} /jacoco/jacoco-it.exec</destFile >
1445
1447
<propertyName >failsafeArgLine</propertyName >
1446
1448
</configuration >
1447
1449
</execution >
1448
-
1449
- <!-- Merge jacoco-it and jacoco-ut into jacoco-aggregated (necessary for next step) -->
1450
1450
<execution >
1451
- <id >merge-results</id >
1452
- <phase >verify</phase >
1451
+ <id >report-unit-tests</id >
1452
+ <goals >
1453
+ <goal >report</goal >
1454
+ </goals >
1455
+ <configuration >
1456
+ <dataFile >${project.build.directory} /jacoco/jacoco-ut.exec</dataFile >
1457
+ <outputDirectory >${project.build.directory} /jacoco/jacoco-ut</outputDirectory >
1458
+ </configuration >
1459
+ </execution >
1460
+ <execution >
1461
+ <id >report-integration-tests</id >
1462
+ <goals >
1463
+ <goal >report-integration</goal >
1464
+ </goals >
1465
+ <configuration >
1466
+ <dataFile >${project.build.directory} /jacoco/jacoco-it.exec</dataFile >
1467
+ <outputDirectory >${project.build.directory} /jacoco/jacoco-it</outputDirectory >
1468
+ </configuration >
1469
+ </execution >
1470
+ <execution >
1471
+ <id >merge-unit-and-integration</id >
1472
+ <phase >post-integration-test</phase >
1453
1473
<goals >
1454
1474
<goal >merge</goal >
1455
1475
</goals >
1456
1476
<configuration >
1457
1477
<fileSets >
1458
1478
<fileSet >
1459
- <directory >${project.build.directory} </directory >
1479
+ <directory >${project.build.directory} /jacoco/ </directory >
1460
1480
<includes >
1461
- <include >jacoco-it.exec</include >
1462
- <include >jacoco-ut.exec</include >
1481
+ <include >jacoco-*.exec</include >
1463
1482
</includes >
1464
1483
</fileSet >
1465
1484
</fileSets >
1466
- <destFile >${project.build.directory} /jacoco-aggregated .exec</destFile >
1485
+ <destFile >${project.build.directory} /jacoco-merged/jacoco .exec</destFile >
1467
1486
</configuration >
1468
1487
</execution >
1469
-
1470
- <!-- We need this step for submitting reports to codacy -->
1471
1488
<execution >
1472
- <id >report-coverage </id >
1473
- <phase >verify </phase >
1489
+ <id >create-merged-report </id >
1490
+ <phase >post-integration-test </phase >
1474
1491
<goals >
1475
1492
<goal >report</goal >
1476
1493
</goals >
1477
1494
<configuration >
1478
- <!-- Sets the path to the file which contains the execution data. -->
1479
- <dataFile >${project.build.directory} /jacoco-aggregated.exec</dataFile >
1480
- <!-- Sets the output directory for the code coverage report. -->
1481
- <outputDirectory >${project.reporting.outputDirectory} /jacoco-aggregated-report</outputDirectory >
1495
+ <dataFile >${project.build.directory} /jacoco-merged/jacoco.exec</dataFile >
1496
+ <outputDirectory >${project.build.directory} /jacoco-merged/jacoco-merged-report</outputDirectory >
1482
1497
</configuration >
1483
1498
</execution >
1484
-
1485
- </executions >
1486
- </plugin >
1487
- </plugins >
1488
- </build >
1489
- </profile >
1490
-
1491
- <profile >
1492
- <id >codacy</id >
1493
- <activation >
1494
- <activeByDefault >false</activeByDefault >
1495
- </activation >
1496
- <build >
1497
- <pluginManagement >
1498
- <plugins >
1499
- <plugin >
1500
- <groupId >com.gavinmogan</groupId >
1501
- <artifactId >codacy-maven-plugin</artifactId >
1502
- <version >${version.codacy.mvn.plugin} </version >
1503
- </plugin >
1504
- </plugins >
1505
- </pluginManagement >
1506
- <plugins >
1507
- <!-- codacy -->
1508
- <plugin >
1509
- <groupId >com.gavinmogan</groupId >
1510
- <artifactId >codacy-maven-plugin</artifactId >
1511
- <configuration >
1512
- <!-- expects to receive the jacoco.xml aggregated report which comes from the report-coverage execution -->
1513
- <coverageReportFile >${project.reporting.outputDirectory} /jacoco-aggregated-report/jacoco.xml</coverageReportFile >
1514
- <apiToken >${env.CODACY_API_TOKEN} </apiToken >
1515
- <projectToken >${env.CODACY_PROJECT_TOKEN_STRONGBOX} </projectToken >
1516
- <commit >${env.GIT_COMMIT} </commit >
1517
- <codacyApiBaseUrl >https://api.codacy.com</codacyApiBaseUrl >
1518
- <failOnMissingReportFile >false</failOnMissingReportFile >
1519
- </configuration >
1520
- <executions >
1521
1499
<execution >
1522
- <id >post-test </id >
1500
+ <id >check </id >
1523
1501
<phase >verify</phase >
1524
1502
<goals >
1525
- <goal >coverage </goal >
1503
+ <goal >check </goal >
1526
1504
</goals >
1505
+ <configuration >
1506
+ <!-- TODO: We need to set this to true when the coverage increases enough -->
1507
+ <haltOnFailure >false</haltOnFailure >
1508
+ <rules >
1509
+ <rule >
1510
+ <element >BUNDLE</element >
1511
+ <excludes >
1512
+ <exclude >*Test.java</exclude >
1513
+ <exclude >*TestIT.java</exclude >
1514
+ </excludes >
1515
+ <limits >
1516
+ <limit >
1517
+ <counter >INSTRUCTION</counter >
1518
+ <value >COVEREDRATIO</value >
1519
+ <minimum >0.7</minimum >
1520
+ </limit >
1521
+ </limits >
1522
+ </rule >
1523
+ </rules >
1524
+ <dataFile >${project.build.directory} /jacoco-merged/jacoco.exec</dataFile >
1525
+ </configuration >
1527
1526
</execution >
1528
1527
</executions >
1529
1528
</plugin >
0 commit comments