As per the documented plugin, I want to put checks in for branch and line
thresholds..
Here is my plugin:
=================
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<!-- BUG IN PLUGIN:
<dataFile>${basedir}/target/cobertura.ser</dataFile>-->
<instrumentation>
<ignores>
<ignore>com/**/*Exception.class</ignore>
<ignore>org/**/*Exception.class</ignore>
</ignores>
<excludes>
<exclude>com/**/*Test.class</exclude>
<exclude>org/**/*Test.class</exclude>
<exclude>com/**/*Exception.class</exclude>
<exclude>org/**/*Exception.class</exclude>
<exclude>org/delta/provider/npi/test/*.class</exclude>
</excludes>
</instrumentation>
<check branchrate="30" linerate="50"
haltonerror="false"
totalbranchrate="25" totallinerate="35">
<regex pattern="com.baselogic.*"
branchrate="30" linerate="50"/>
<regex pattern="org.delta.*"
branchrate="10" linerate="30"/>
</check>
</configuration>
<executions>
<execution>
<id>clean</id>
<goals>
<goal>clean</goal>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
==================================================
Here is the error I get when I run this:
NOTE: When I remove the <check>... I do not have any issues...
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for:
org.codehaus.mojo:cobertura-maven-plugin:2.0
on the command line, specify: '-Dcheck=VALUE'
Cause: Cannot find setter nor field in
org.codehaus.mojo.cobertura.configuration.ConfigCheck for 'regex'
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error configuring:
org.codehaus.mojo:cobertura-maven-plugin. Reason: Unable to parse the creat
ed DOM for plugin configuration
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:563)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:475)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
DefaultLifecycleExecutor.java:454)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:306)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:273)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
DefaultLifecycleExecutor.java:140)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
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.PluginConfigurationException: Error
configuring: org.codehaus.mojo:cobertura-maven-plugin. Reason: Unable to
parse
the created DOM for plugin configuration
at org.apache.maven.plugin.DefaultPluginManager.populatePluginFields
(DefaultPluginManager.java:1036)
at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(
DefaultPluginManager.java:576)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
DefaultPluginManager.java:390)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:534)
... 16 more
Caused by:
org.codehaus.plexus.component.configurator.ComponentConfigurationException:
Cannot find setter nor field in org.codehaus.mojo.cobertura.con
figuration.ConfigCheck for 'regex'
at
org.codehaus.plexus.component.configurator.converters.ComponentValueSetter
.<init>(ComponentValueSetter.java:68)
at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration
(ObjectWithFieldsConverter.ja
va:134)
at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration
(ObjectWithFieldsConverter.java:
90)
at
org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure
(ComponentValueSetter.java:247)
at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration
(ObjectWithFieldsConverter.ja
va:137)
at
org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent
(BasicComponentConfigurator.java:56)
at org.apache.maven.plugin.DefaultPluginManager.populatePluginFields
(DefaultPluginManager.java:1030)
... 19 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Fri Nov 17 11:06:21 PST 2006
[INFO] Final Memory: 6M/11M
[INFO]
------------------------------------------------------------------------
--
Thanks
DJ MICK
http://www.djmick.com
http://www.myspace.com/mickknutson