It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Groovy code is not instrumented and no database is created Edited

Hello!

 

I want to apply Clover to Groovy code in a non-default directory (namely vars). I use Spock as test framework. I use GMavenPlus to add and compile the sources, which are recognized by Clover but not instrumented. I get the following messages:

[INFO] No Clover instrumentation done on source files in: [C:\Users\..\src\main\java, C:\..\vars] as no matching sources files found (JAVA_LANGUAGE)

 

The build section of my POM looks like this:

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>

<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.6.2</version>
<executions>
<execution>
<id>default-groovy-compile</id>
<goals>
<goal>addSources</goal>
<goal>addTestSources</goal>
<goal>compile</goal>
<goal>compileTests</goal>
</goals>
<configuration>
<sources>
<source>
<directory>${project.basedir}/vars</directory>
<includes>
<include>**/*.groovy</include>
</includes>
</source>
</sources>
<testSources>
<testSource>
<directory>${project.basedir}/test</directory>
<includes>
<include>**/*Spec*</include>
</includes>
</testSource>
</testSources>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.pluginVersion}</version>
<executions>
<execution>
<id>default-test</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>
<include>**/*Spec*</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.openclover</groupId>
<artifactId>clover-maven-plugin</artifactId>
<version>4.3.1</version>
<executions>
<execution>
<id>default-setup</id>
<phase>generate-sources</phase>
<goals>
<goal>setup</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>**/*</include>
</includes>
</configuration>
</plugin>

</plugins>

<resources>
<resource>
<includes>
<include>Jenkinsfile</include>
<include>jobs/**/*.groovy</include>
<include>vars/**/*.groovy</include>
</includes>
<directory>${project.basedir}</directory>
</resource>
</resources>

</build>

 

I call the build via CLI with the following command:

mvn clean test clover:aggregate clover:clover

 

The sources are added before clover:setup is called.

 

My system setup is:

Maven: 3.6.0

JDK: OpenJDK 12.0.1

Clover: 4.3.1

Groovy: 2.5.6

OS: Windows 10

 

Thanks in advance!

 

Kind Regards,

Oliver

1 answer

0 votes

The 

No Clover instrumentation done on source files in ... JAVA_LANGUAGE

is a warning for missing Java code, so you shall not worry about it in your case. 

 

In your case it seems to be a problem with attaching Clover to Groovy compiler.

Enable debug logging (`mvn -X` option) and look for a message like '

Clover including the following files for Groovy instrumentation: ...

Check if any source files are listed here. If not, then there's some problem with your inclusion pattern or source roots. 

See sources of com.atlassian.maven.plugin.clover.CloverInstrumentInternalMojo#injectGrover to learn more how it work.

 

See also:

http://openclover.org/doc/manual/latest/maven--compiling-with-gmaven-plugin.html

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Keep your team in the loop with Team @mentions in Jira Software!

Hi everyone! My name is Jenny, a Product Manager at Atlassian. After launching Team @mentions in Confluence, we heard a lot of positive feedback from customers that they love how easy it is to @men...

226 views 4 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you