Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Include M2E ignore file in jacoco-maven-plugin #203
Could jacoco include a file like the following with each of the goals that should not be run by M2E in the list of goals so that M2E users do not need to manually ignore it? The file needs to be in the plugin jar file at META-INF/m2e/lifecycle-mapping-metadata.xml
More documentation can be found at: http://wiki.eclipse.org/M2E_compatible_maven_plugins
I can contribute a fix but I am not sure where to put the file as the maven plugin doesn't use the standard maven directory layout so it may not support src/main/resources/META-INF/.... Should I create a new resources directory next to the src directory? Ie, "jacoco-maven-plugin/resources"?
This should already be in place in the Eclipse plugin for JaCoCo (EclEmma):
Can you please verify whether this works for you?
I am not sure how that is relevant to M2E and jacoco-maven-plugin. Do I need to install that Eclipse plugin to avoid seeing the M2E messages?
Is it possible for you to copy and paste (or move) the file into jacoco-maven-plugin.jar so it comes directly through Maven without the extra plugin?
Thanks, installing EclEmma fixed the bug!
It would however be easiest to also copy the file into the jacoco-maven-plugin so that all M2E users get it automatically. There is no extra dependency on M2E. As with the file inside of the EclEmma plugin jar file, M2E will automatically detect it based on scanning the classpath for all matching META-INF... files.
Including all of the goals that could be included in a pom.xml file would be useful in my view:
The ones that are unlikely to ever be included in pom.xml, and run manually instead may not need to be there:
The list above is based on:
Apr 15, 2014
added a commit
Mar 29, 2015
I get a compilation error when I compile from the git repository using oracle jdk 8:
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ org.jacoco.core.test ---
Looking at the pom.xml file there is a profile that I could select to disable the compilation of those classes, but it isn't clear why the compilation should work for java-8 users, given that the source and target for the maven-compiler-plugin are both inherited from the maven.compiler.source and maven.compiler.target properties defined in the org.jacoco.build pom, with or without the profile being active.
My environment is Oracle JDK 8 on Ubuntu 14.04:
After compiling using "mvn -Pno-java8-validation clean install", it seems to work.
I verified that the M2E error appears with 0.7.4.201502262128 but does not appear when I changed that to 0.7.5-SNAPSHOT to use my locally compiled version.