Skip to content

Commit

Permalink
Fix Jacoco coverage repots in Sonar (#136)
Browse files Browse the repository at this point in the history
Now that inject and plexus are consolidated, they should not step on each other toe, and write to top level target directory the report.

This does NOT fix Sonar, that for me, unknown reason, does not pick up generated Jacoco reports. Still, the reports on local builds are there and are usable.
  • Loading branch information
cstamas committed May 31, 2024
1 parent 1305b17 commit a5f51ed
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 50 deletions.
27 changes: 0 additions & 27 deletions org.eclipse.sisu.inject/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -423,33 +423,6 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<propertyName>jacoco.argLine</propertyName>
<excludes>
<exclude>Incomplete*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>jacoco-prepare</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<title>Sisu Inject</title>
<outputDirectory>${project.basedir}/../target/site/jacoco</outputDirectory>
<excludes>
<exclude>**/asm/*</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
22 changes: 0 additions & 22 deletions org.eclipse.sisu.plexus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -439,28 +439,6 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<propertyName>jacoco.argLine</propertyName>
</configuration>
<executions>
<execution>
<id>jacoco-prepare</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<title>Sisu Plexus</title>
<outputDirectory>${project.basedir}/../target/site/jacoco</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private Object convertProperty( final Class<?> beanType, final Class<?> rawPrope
}

private static Method findMethod( final Class<?> beanType, final Type[] paramTypeHolder, final String methodName,
final Class<?> valueType )
final Class<?> valueType )
{
Method candidate = null;
for ( final Method m : beanType.getMethods() )
Expand Down
34 changes: 34 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@
<artifactId>org.eclipse.sisu.plexus</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
<version>${project.version}</version>
</dependency>

<!--
| Sisu is compatible with Guice 3.0+
Expand Down Expand Up @@ -426,6 +431,31 @@ Bundle-DocURL: http://www.eclipse.org/sisu/
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<configuration>
<propertyName>jacoco.argLine</propertyName>
<excludes>
<exclude>**/asm/*</exclude>
<exclude>Incomplete*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>jacoco-prepare</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<title>${project.name}</title>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -529,6 +559,10 @@ Bundle-DocURL: http://www.eclipse.org/sisu/
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit a5f51ed

Please sign in to comment.