Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,364,358
Community Members
 
Community Events
168
Community Groups

Does clover work with the groovy-eclipse-plugin?

Does clover work with the groovy-eclipse-plugin?


I tried using clover 3.1.6 with the groovy-eclipse-compiler and I get the following error.

[INFO] Preparing clover2:instrument

[WARNING] Removing: instrument from forked lifecycle, to prevent recursive invocation.

[INFO] [enforcer:enforce {execution: default}]

[INFO] [clover2:instrumentInternal]

[INFO] Clover Version 3.1.6, built on June 19 2012 (build-867)

[INFO] Loaded from: C:\Repository\com\cenqua\clover\clover\3.1.6\clover-3.1.6.jar

[INFO] ------------------------------------------------------------------------

[ERROR] BUILD ERROR

[INFO] ------------------------------------------------------------------------

[INFO] Clover has failed to instrument the source files in the [C:\workspaces\workspace\genesis-application-library-warden\target\clover\src] directory

[INFO] ------------------------------------------------------------------------

[INFO] For more information, run Maven with the -e switch

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 22 seconds

[INFO] Finished at: Wed Aug 22 17:06:09 CDT 2012

[INFO] Final Memory: 70M/167M

[INFO] ------------------------------------------------------------------------

Before switching from gmaven to groovy-eclipse-compiler it worked fine. We have been resolving these issues temporarly by switching out clover for cobertura, but this is not something we want to keep long term.

This bug https://jira.atlassian.com/browse/CLOV-1021 states that clover was enhanced to handle the groovy-eclipse-plugin with version 3.1.3. We are using version 3.1.6

Here is how we setup the groovy-eclipse-compiler

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<version>2.5.1</version>

<configuration>

<source>1.6</source>

<target>1.6</target>

<encoding>UTF-8</encoding>

<compilerId>groovy-eclipse-compiler</compilerId>

</configuration>

<dependencies>

<dependency>

<groupId>org.codehaus.groovy</groupId>

<artifactId>groovy-eclipse-batch</artifactId>

<version>1.7.10-06</version>

</dependency>

<dependency>

<groupId>org.codehaus.groovy</groupId>

<artifactId>groovy-eclipse-compiler</artifactId>

<version>2.6.0-01</version>

</dependency>

</dependencies>

</plugin>

What version of the groovy-eclipse-compiler does clover support?

6 answers

1 accepted

0 votes
Answer accepted

Clover works with groovy-eclipse-compiler, however you have to put Groovy sources in a standard location, i.e. src/main/groovy or src/test/groovy.

If you put Groovy files in Java source folder (src/.../java - it's suggested on Groovy-Eclipse+compiler+plugin+for+Maven page, section "Setting up the source folders / Do nothing"), then a build fails with error like below:

[INFO] BUILD FAILURE
...
[ERROR] Failed to execute goal com.atlassian.maven.plugins:maven-clover2-plugin:3.1.7:setup (default-cli) on project test.project: Clover has failed to instrument the source files in the [C:\MyProject\target\clover\src-instrumented] directory -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.atlassian.maven.plugins:maven-clover2-plugin:3.1.7:setup (default-cli) on project test.project: Clover has failed to instrument the source files in the [C:\MyProject\target\clover\src-instrumented] directory at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) ...
[ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException *** ERROR: No source files specified USAGE: com.cenqua.clover.CloverInstr [OPTIONS] PARAMS [FILES...]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The bug CLOV-1144 has been reported to get rid of this limitation.

Regards
Marek

0 votes

Please have a look at the manual:

where you can find exemplary pom.xml for Maven 2 and 3.

There is also a manual for old GMaven plugin as well:

Thanks for the response Marek. I tried using clover2:setup and <extensions>true</extensions> but it appears that I am having the same issue. I will work on getting an issue logged at support.atlassian.com

0 votes

Have you tried to use 'clover2:setup'? You're using 'clover2:instrument' goal, which creates a parallel build lifecycle; and the groovy-eclipse-compiler also modifies a build lifecycle, adding extra phase, so it might be a case that they clash with each other. I've also noticed that you don't have "<extensions>true</extensions>" property defined for groovy-eclipse-compiler. See:

http://groovy.codehaus.org/Groovy-Eclipse+compiler+plugin+for+Maven

0 votes

Hi,

From attached build log I cannot say what exactly went wrong. Could you raise an issue at support.atlassian.com and attach some code sample and a full build log from 'mvn -X' command?

Regards
Marek

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events