add coverage profile to maven project

This commit is contained in:
Stefan Kalscheuer 2020-04-25 12:33:22 +02:00
parent be7aa865d8
commit 46461f482a
2 changed files with 43 additions and 5 deletions

View File

@ -39,7 +39,7 @@ jobs:
- name: Unit and Integration Tests - name: Unit and Integration Tests
if: branch =~ ^master|(release/.+)$ if: branch =~ ^master|(release/.+)$
script: script:
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package - mvn -P coverage clean package
- stage: Analysis - stage: Analysis
if: branch = master if: branch = master
script: script:

46
pom.xml
View File

@ -147,13 +147,13 @@
<dependency> <dependency>
<groupId>net.bytebuddy</groupId> <groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId> <artifactId>byte-buddy</artifactId>
<version>1.10.8</version> <version>1.10.9</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.bytebuddy</groupId> <groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId> <artifactId>byte-buddy-agent</artifactId>
<version>1.10.8</version> <version>1.10.9</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -164,6 +164,16 @@
</dependency> </dependency>
</dependencies> </dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.7.0.1746</version>
</dependency>
</dependencies>
</dependencyManagement>
<profiles> <profiles>
<profile> <profile>
@ -176,7 +186,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
<version>3.1.0</version> <version>3.2.1</version>
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
@ -200,7 +210,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version> <version>3.2.0</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
</configuration> </configuration>
@ -242,6 +252,34 @@
</build> </build>
</profile> </profile>
<profile>
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile> <profile>
<id>offline-tests</id> <id>offline-tests</id>
<build> <build>