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 13:14:29 UTC

[m2] Checkstyle reports

I've been trying to get Checkstyle to produce a report for a while now,
and it doesn't seem to want to work. I've noticed a couple of similar
unresolved problems on this list, but I'll add all the detail I can, and
I'm happy to experiment and patch code. I started off with the release
version of Maven 2 (2.0), with a report configuration of

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>

When I run 'mvn site' for this, I get:

[INFO] [site:site]
[INFO] Generate "Checkstyle" report.
[INFO]
------------------------------------------------------------------------
-
---
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
-
---
---------------------------------------------------
constituent[0]: file:/d:/libraries/maven-2.0/lib/commons-cli-1.0.jar
constituent[1]:
file:/d:/libraries/maven-2.0/lib/doxia-sink-api-1.0-alpha-4.jar
constituent[2]: file:/d:/libraries/maven-2.0/lib/jsch-0.1.23.jar
constituent[3]:
file:/d:/libraries/maven-2.0/lib/maven-artifact-2.0-1.jar
constituent[4]:
file:/d:/libraries/maven-2.0/lib/maven-artifact-manager-2.0-1.ja
r
constituent[5]: file:/d:/libraries/maven-2.0/lib/maven-core-2.0.jar
constituent[6]:
file:/d:/libraries/maven-2.0/lib/maven-error-diagnostics-2.0.jar

constituent[7]: file:/d:/libraries/maven-2.0/lib/maven-model-2.0.jar
constituent[8]: file:/d:/libraries/maven-2.0/lib/maven-monitor-2.0.jar
constituent[9]:
file:/d:/libraries/maven-2.0/lib/maven-plugin-api-2.0.jar
constituent[10]:
file:/d:/libraries/maven-2.0/lib/maven-plugin-descriptor-2.0.ja
r
constituent[11]:
file:/d:/libraries/maven-2.0/lib/maven-plugin-parameter-documen
ter-2.0.jar
constituent[12]:
file:/d:/libraries/maven-2.0/lib/maven-plugin-registry-2.0.jar
constituent[13]: file:/d:/libraries/maven-2.0/lib/maven-profile-2.0.jar
constituent[14]:
file:/d:/libraries/maven-2.0/lib/maven-project-2.0-1.jar
constituent[15]:
file:/d:/libraries/maven-2.0/lib/maven-reporting-api-2.0.jar
constituent[16]:
file:/d:/libraries/maven-2.0/lib/maven-repository-metadata-2.0.
jar
constituent[17]: file:/d:/libraries/maven-2.0/lib/maven-settings-2.0.jar
constituent[18]:
file:/d:/libraries/maven-2.0/lib/plexus-interactivity-api-1.0-a
lpha-4.jar
constituent[19]:
file:/d:/libraries/maven-2.0/lib/wagon-file-1.0-alpha-5.jar
constituent[20]:
file:/d:/libraries/maven-2.0/lib/wagon-http-lightweight-1.0-alp
ha-5.jar
constituent[21]:
file:/d:/libraries/maven-2.0/lib/wagon-provider-api-1.0-alpha-5
.jar
constituent[22]:
file:/d:/libraries/maven-2.0/lib/wagon-ssh-1.0-alpha-5.jar
---------------------------------------------------
java.lang.NullPointerException
        at
org.apache.maven.usability.diagnostics.DiagnosisUtils.appendRootCauseIfP
resentAndUnique(DiagnosisUtils.java:89)
        at
org.apache.maven.usability.diagnostics.ErrorDiagnostics$PuntErrorDiagnos
er.diagnose(ErrorDiagnostics.java:132)
        at
org.apache.maven.usability.diagnostics.ErrorDiagnostics.diagnose(ErrorDi
agnostics.java:104)
        at
org.apache.maven.DefaultMaven.logDiagnostics(DefaultMaven.java:693)
        at org.apache.maven.DefaultMaven.logFatal(DefaultMaven.java:627)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:143)
        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)

So, I then thought I'd try the latest development version of the plugin,
see if that helps. This installed
maven-checkstyle-plugin-2.0-beta-2-SNAPSHOT, which produces the
following output from 'mvn site' for my project:

[INFO] [site:site]
[INFO] Generate "Checkstyle" report.
[INFO]
------------------------------------------------------------------------
-
---
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
-
---
[INFO] Error during report generation

Embedded error: Failed during checkstyle configuration
java.lang.NullPointerException
[INFO]
------------------------------------------------------------------------
-
---
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error during
report generation
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:544)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec
ycle(DefaultLifecycleExecutor.java:469)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
ifecycleExecutor.java:448)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.java:301)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:268)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
ycleExecutor.java:137)
        at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
        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: Error during
report generation
        at
org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:389)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa
nager.java:399)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:519)
        ... 16 more
Caused by: org.apache.maven.reporting.MavenReportException: Failed
during checkstyle configuration
        at
org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(Checks
tyleReport.java:461)
        at
org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenRep
ort.java:98)
        at
org.apache.maven.plugins.site.SiteMojo.generateReportsPages(SiteMojo.jav
a:802)
        at
org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:301)
        ... 18 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException:
unable to parse default package names - java.lang.NullPointerException
        at
com.puppycrawl.tools.checkstyle.PackageNamesLoader.loadModuleFactory(Pac
kageNamesLoader.java:194)
        at
com.puppycrawl.tools.checkstyle.PackageNamesLoader.loadModuleFactory(Pac
kageNamesLoader.java:146)
        at
org.apache.maven.plugin.checkstyle.CheckstyleReport.getModuleFactory(Che
ckstyleReport.java:823)
        at
org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(Checks
tyleReport.java:455)
        ... 21 more
Caused by: java.lang.NullPointerException
        at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:658)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
        at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)

        at
com.puppycrawl.tools.checkstyle.api.AbstractLoader.parseInputSource(Abst
ractLoader.java:96)
        at
com.puppycrawl.tools.checkstyle.PackageNamesLoader.loadModuleFactory(Pac
kageNamesLoader.java:184)
        ... 24 more

Near as I can tell from the code, the parser is getting a
NullPointerException parsing the default package names for Checkstyle
(resource com/puppycrawl/tools/checkstyle/checkstyle_packages.xml). The
file appears fine in the Checkstyle jar in the local repository, so I'm
now out of ideas...

Thanks in advance,

Nick
 
 
       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 reports

Posted by "Deepika.M" <de...@gmail.com>.
Hi Nick,

I too am trying to get checkstyle report using M2.

I got the same error "FATAL ERROR" when I trired to use
maven-checkstyle-plugin-2.0
>
> -beta-1-SNAPSHOT plugin
>

U better try it with ' mvn checkstyle:checkstyle' goal  for checkstyle
report generation separately.

-------------
Regards
Deepika.S