You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Giles, Nick" <Ni...@cognos.com> on 2005/12/14 16:47:57 UTC
[m2] Checkstyle severity attribute problem
When I provide the Checkstyle plugin with a customised config file, it
causes it to crash unpleasantly when generating the report. It appears
that this is due to calling the 'remove' method on Arrays$ArrayList,
which doesn't implement the method. The call is actually removing the
'severity' property from the list of columns before going on to process
the rest. Wrapping the list in an actual ArrayList (java.util.ArrayList)
solves the problem. Is this specific to my versions, or has anyone else
had this problem, in which case I'll submit a patch.
Info:
Java - 1.4.2_10
Maven - 2.0.2-SNAPSHOT (updated this morning from the repository)
Maven-checkstyle-plugin - 2.0-beta-2-SNAPSHOT (also updated this
morning)
To replicate, add <configLocation>your-rules.xml</configLocation> to the
plugin configuration, and ensure that at least two modules in
your-rules.xml have the severity property set, something like:
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<module name="PackageHtml">
<property name="severity" value="warning" />
</module>
<module name="NewlineAtEndOfFile">
<property name="severity" value="info" />
</module>
</module>
Stack trace appended.
Thanks,
Nick
org.apache.maven.lifecycle.LifecycleExecutionException: An error has
occurred in Checkstyle report generation.
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:555)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoa
l(DefaultLifecycleExecutor.java:485)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
ifecycleExecutor.java:455)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.java:303)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:270)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
ycleExecutor.java:139)
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:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
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: An error has
occurred in Checkstyle report generation.
at
org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenRepo
rt.java:79)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa
nager.java:432)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:530)
... 16 more
Caused by: java.lang.UnsupportedOperationException
at java.util.AbstractList.remove(AbstractList.java:171)
at java.util.AbstractList$Itr.remove(AbstractList.java:436)
at
java.util.AbstractCollection.remove(AbstractCollection.java:255)
at
org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.doRuleRow(C
heckstyleReportGenerator.java:294)
at
org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.doRuleChild
ren(CheckstyleReportGenerator.java:282)
at
org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.doRulesSumm
ary(CheckstyleReportGenerator.java:252)
at
org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.generateRep
ort(CheckstyleReportGenerator.java:107)
at
org.apache.maven.plugin.checkstyle.CheckstyleReport.generateMainReport(C
heckstyleReport.java:563)
at
org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(Checks
tyleReport.java:472)
at
org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenRep
ort.java:98)
at
org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenRepo
rt.java:73)
This message may contain privileged and/or confidential information. If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate or distribute it; do not open any attachments, delete it immediately from your system and notify the sender promptly by e-mail that you have done so. Thank You.
Re: [m2] Checkstyle severity attribute problem
Posted by Edwin Punzalan <ep...@exist.com>.
Please file a jira issue for this so we can check it out. Thanks. ^_^
Giles, Nick wrote:
>When I provide the Checkstyle plugin with a customised config file, it
>causes it to crash unpleasantly when generating the report. It appears
>that this is due to calling the 'remove' method on Arrays$ArrayList,
>which doesn't implement the method. The call is actually removing the
>'severity' property from the list of columns before going on to process
>the rest. Wrapping the list in an actual ArrayList (java.util.ArrayList)
>solves the problem. Is this specific to my versions, or has anyone else
>had this problem, in which case I'll submit a patch.
>
>Info:
>Java - 1.4.2_10
>Maven - 2.0.2-SNAPSHOT (updated this morning from the repository)
>Maven-checkstyle-plugin - 2.0-beta-2-SNAPSHOT (also updated this
>morning)
>
>To replicate, add <configLocation>your-rules.xml</configLocation> to the
>plugin configuration, and ensure that at least two modules in
>your-rules.xml have the severity property set, something like:
>
><?xml version="1.0"?>
><!DOCTYPE module PUBLIC
> "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
> "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
>
><module name="Checker">
>
> <module name="PackageHtml">
> <property name="severity" value="warning" />
> </module>
>
> <module name="NewlineAtEndOfFile">
> <property name="severity" value="info" />
> </module>
></module>
>
>Stack trace appended.
>
>Thanks,
>
>Nick
>
>org.apache.maven.lifecycle.LifecycleExecutionException: An error has
>occurred in Checkstyle report generation.
> at
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
>LifecycleExecutor.java:555)
> at
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoa
>l(DefaultLifecycleExecutor.java:485)
> at
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
>ifecycleExecutor.java:455)
> at
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
>Failures(DefaultLifecycleExecutor.java:303)
> at
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
>DefaultLifecycleExecutor.java:270)
> at
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
>ycleExecutor.java:139)
> 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:249)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
>a:39)
> at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>Impl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> 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: An error has
>occurred in Checkstyle report generation.
> at
>org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenRepo
>rt.java:79)
> at
>org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa
>nager.java:432)
> at
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
>LifecycleExecutor.java:530)
> ... 16 more
>Caused by: java.lang.UnsupportedOperationException
> at java.util.AbstractList.remove(AbstractList.java:171)
> at java.util.AbstractList$Itr.remove(AbstractList.java:436)
> at
>java.util.AbstractCollection.remove(AbstractCollection.java:255)
> at
>org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.doRuleRow(C
>heckstyleReportGenerator.java:294)
> at
>org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.doRuleChild
>ren(CheckstyleReportGenerator.java:282)
> at
>org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.doRulesSumm
>ary(CheckstyleReportGenerator.java:252)
> at
>org.apache.maven.plugin.checkstyle.CheckstyleReportGenerator.generateRep
>ort(CheckstyleReportGenerator.java:107)
> at
>org.apache.maven.plugin.checkstyle.CheckstyleReport.generateMainReport(C
>heckstyleReport.java:563)
> at
>org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(Checks
>tyleReport.java:472)
> at
>org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenRep
>ort.java:98)
> at
>org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenRepo
>rt.java:73)
>
>
> This message may contain privileged and/or confidential information. If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate or distribute it; do not open any attachments, delete it immediately from your system and notify the sender promptly by e-mail that you have done so. Thank You.
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org