Error when excluding all java files in a module
-----------------------------------------------
Key: MCLOVER-79
URL: http://jira.codehaus.org/browse/MCLOVER-79
Project: Maven 2.x Clover Plugin
Issue Type: Bug
Affects Versions: 2.4
Environment: Maven 2.0.5, Clover Plugin 2.4, JDK 1.5.0_11
Reporter: Daniel Gredler
Fix For: 2.5
We have some modules in our project which we'd like to exclude from the clover
instrumentation and/or reports. We added the following to the POMs for these
modules, in order to exclude all files within them:
<build>
<plugins>
<plugin>
<artifactId>maven-clover-plugin</artifactId>
<configuration><excludes><exclude>**/*.java</exclude></excludes></configuration>
</plugin>
</plugins>
</build>
However, the clover plugin throws an error if there are no files to instrument:
*** ERROR: No source files specified
USAGE: com.cenqua.clover.CloverInstr [OPTIONS] PARAMS [FILES...]
PARAMS:
-i, --initstring <file> Clover initstring. This is the path to the
dbfile that
will be used to construct/update to store
coverage data.
-s, --srcdir <dir> Directory containing source files to be
instrumented. If omitted
individual source files should be specified on
the command line.
-d, --destdir <dir> Directory where Clover should place the
instrumented sources.
OPTIONS:
-p, --flushpolicy <policy> Set the flushpolicy Clover will use during
coverage recording.
legal values are
"directed","interval","threaded". Default is "directed". If
either "interval" or "threaded" policies is
used, the flushinterval must also be set
using the -f option.
-f, --flushinterval <int> Set the interval between flushes (in
millisecs). Only applies to
"interval" or "threaded" flush policies.
-e, --encoding <encoding> Set the File encoding to use when reading
source files.
--instrumentation <string> Set the instrumentation strategy. Valid values
are "field" and
"class". Default is "class".
-jdk14 Direct Clover to parse sources using the
JDK1.4 grammar.
-jdk15 Direct Clover to parse sources using the
JDK1.5 grammar.
-v, --verbose Enable verbose logging.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Clover has failed to instrument the source files
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Clover has failed to
instrument the source files
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:896)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:739)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:510)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Clover has failed to
instrument the source files
at
org.apache.maven.plugin.clover.CloverInstrumentInternalMojo.instrumentSources(CloverInstrumentInternalMojo.java:188)
at
org.apache.maven.plugin.clover.CloverInstrumentInternalMojo.execute(CloverInstrumentInternalMojo.java:146)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:420)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
... 20 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira