Issue Type: Bug Bug
Affects Versions: codenarc-maven-plugin-0.17-2
Assignee: Garvin LeClaire
Attachments: mojo_fail.patch
Components: codenarc
Created: 10/Oct/12 12:20 PM
Description:

This is a duplicate of http://jira.codehaus.org/browse/MOJO-1873 but I forgot to put in the component on it and can't go back and edit it.

When the number of violations for a priority level is surpassed then fail method does not look to be called correctly. Below is the groovy.lang.MissingMethodException exception that is thrown. Instead of calling the fail method a exception of type MojoFailureException should be thrown. This is according to the maven docs at http://maven.apache.org/guides/plugin/guide-java-plugin-development.html

[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] No signature of method: org.codehaus.mojo.codenarc.CodeNarcMojo.fail() is applicable for argument types: (java.lang.String) values: {"totalPriority1Violations exceeded threshold of 0 errors with 2"}
[INFO] ------------------------------------------------------------------------
[INFO] Trace
groovy.lang.MissingMethodException: No signature of method: org.codehaus.mojo.codenarc.CodeNarcMojo.fail() is applicable for argument types: (java.lang.String) values: {"totalPriority1Violations exceeded threshold of 0 errors with 2"}
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:91)
	at org.codehaus.mojo.codenarc.CodeNarcMojo.executeReport(CodeNarcMojo.groovy:397)
	at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:190)
	at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:99)
	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
	at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
	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:597)
	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)
	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:597)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Environment: Maven 2.2.1
Project: Mojo
Priority: Major Major
Reporter: Ben McGuire
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to