jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x PMD Plugin
  • MPMD-142

PMD Report for maven site fails with ClassCastException

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.7
  • Fix Version/s: 2.7.1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Maven 2.2.1, Jenkins 1.424.1, Linux RHEL 5

Description

Maven 2.2.1 is complaining when mvn site is run.
It is stopping in PMD report.
Section from log is below.
This error appeared freshly this morning. The site goal run successfully before.

[INFO] Generating "PMD Report" report.
[WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink instance and no SinkFactory available. Please update this plugin.
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] java.lang.String cannot be cast to java.io.File
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.ClassCastException: java.lang.String cannot be cast to java.io.File
	at org.apache.maven.plugin.pmd.AbstractPmdReport.getFilesToProcess(AbstractPmdReport.java:284)
	at org.apache.maven.plugin.pmd.PmdReport.generateReport(PmdReport.java:249)
	at org.apache.maven.plugin.pmd.PmdReport.execute(PmdReport.java:175)
	at org.apache.maven.plugin.pmd.PmdReport.executeReport(PmdReport.java:149)
	at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:190)
	at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:144)
	at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:139)
	at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:269)
	at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:101)
	at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:133)
	at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:100)
	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)
  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. XML File
    testpom.xml
    06/Feb/12 3:44 PM
    0.9 kB
    Jan Ruzicka

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Jan Ruzicka added a comment - 06/Feb/12 10:29 AM

this error appears for all goals pmd:check, pmd:cpd-check, pmd:pmd, pmd:cpd

Show
Jan Ruzicka added a comment - 06/Feb/12 10:29 AM this error appears for all goals pmd:check, pmd:cpd-check, pmd:pmd, pmd:cpd
Hide
Permalink
Dennis Lundberg added a comment - 06/Feb/12 3:15 PM

Can you supply a small sample project that exhibits this problem?

Show
Dennis Lundberg added a comment - 06/Feb/12 3:15 PM Can you supply a small sample project that exhibits this problem?
Hide
Permalink
Jan Ruzicka added a comment - 06/Feb/12 3:42 PM

It seems to be triggered by exclusion using excludeRoots.

Show
Jan Ruzicka added a comment - 06/Feb/12 3:42 PM It seems to be triggered by exclusion using excludeRoots.
Hide
Permalink
Jan Ruzicka added a comment - 06/Feb/12 3:44 PM

Empty project with attached pom would trigger the execption.

Show
Jan Ruzicka added a comment - 06/Feb/12 3:44 PM Empty project with attached pom would trigger the execption.
Hide
Permalink
Dennis Lundberg added a comment - 06/Feb/12 4:16 PM

Jan, thanks for the sample project.

I've reproduced the problem locally and have a fix in the works. In the mean time you can use version 2.6 of the plugin as a work-around.

Show
Dennis Lundberg added a comment - 06/Feb/12 4:16 PM Jan, thanks for the sample project. I've reproduced the problem locally and have a fix in the works. In the mean time you can use version 2.6 of the plugin as a work-around.
Hide
Permalink
Dennis Lundberg added a comment - 06/Feb/12 4:33 PM

Please try the 2.7.1-SNAPSHOT that I just deployed.

Show
Dennis Lundberg added a comment - 06/Feb/12 4:33 PM Please try the 2.7.1-SNAPSHOT that I just deployed.
Hide
Permalink
Jan Ruzicka added a comment - 06/Feb/12 5:47 PM

Thank you, the 2.7.1-SNAPSHOT worked without Exception. The biggest delay was fighting Nexus.

Show
Jan Ruzicka added a comment - 06/Feb/12 5:47 PM Thank you, the 2.7.1-SNAPSHOT worked without Exception. The biggest delay was fighting Nexus.
Hide
Permalink
Dennis Lundberg added a comment - 07/Feb/12 12:23 AM

Fixed in r1241358.

Show
Dennis Lundberg added a comment - 07/Feb/12 12:23 AM Fixed in r1241358.
Hide
Permalink
Jordan Hein added a comment - 07/Feb/12 10:40 AM

Thanks for the quick fix. For the record my CI builds broke yesterday with this error and I can report that it occurs in version 2.5, 2.6, and 2.7. I did not try any other versions.

Show
Jordan Hein added a comment - 07/Feb/12 10:40 AM Thanks for the quick fix. For the record my CI builds broke yesterday with this error and I can report that it occurs in version 2.5, 2.6, and 2.7. I did not try any other versions.
Hide
Permalink
Dennis Lundberg added a comment - 07/Feb/12 10:46 AM

Jordan,

This issue only affects 2.7, not any other versions.

Show
Dennis Lundberg added a comment - 07/Feb/12 10:46 AM Jordan, This issue only affects 2.7, not any other versions.
Hide
Permalink
Jordan Hein added a comment - 07/Feb/12 10:51 AM

Hmmm... perhaps I am using 2.7 without knowing it some how despite having the version set explicitly in my pom. I'll look into that and report back.

Show
Jordan Hein added a comment - 07/Feb/12 10:51 AM Hmmm... perhaps I am using 2.7 without knowing it some how despite having the version set explicitly in my pom. I'll look into that and report back.
Hide
Permalink
Jordan Hein added a comment - 07/Feb/12 11:45 AM

You are right, this effects only 2.7. I only had the pmd plugin configured in the reporting section of my pom and not in the build section, thus I was unwittingly using 2.7. Once I sorted this out for good measure I did test with 2.5 and 2.6 and they both work fine. Thanks again for the quick fix and I'll look forward to the next release.

Show
Jordan Hein added a comment - 07/Feb/12 11:45 AM You are right, this effects only 2.7. I only had the pmd plugin configured in the reporting section of my pom and not in the build section, thus I was unwittingly using 2.7. Once I sorted this out for good measure I did test with 2.5 and 2.6 and they both work fine. Thanks again for the quick fix and I'll look forward to the next release.
Hide
Permalink
Robert Scholte added a comment - 07/Feb/12 1:46 PM

Added IT to prevent regression (although this is not a Maven 3 issue) rev. 1241574

Show
Robert Scholte added a comment - 07/Feb/12 1:46 PM Added IT to prevent regression (although this is not a Maven 3 issue) rev. 1241574
Hide
Permalink
Jan Ruzicka added a comment - 08/Feb/12 9:25 AM

is 2.7.1 released? I have troubles finding the release. The Maven Central http://repo1.maven.org/maven2/ doesn't have it nor does the Apache Releases https://repository.apache.org/content/repositories/releases .

Show
Jan Ruzicka added a comment - 08/Feb/12 9:25 AM is 2.7.1 released? I have troubles finding the release. The Maven Central http://repo1.maven.org/maven2/ doesn't have it nor does the Apache Releases https://repository.apache.org/content/repositories/releases .
Hide
Permalink
Robert Scholte added a comment - 08/Feb/12 12:43 PM

No, but this issue will be fixed with this version once released.
You can see at the Jira versions tab of the plugin when every version was released.
I've deployed a snapshot, you can use https://repository.apache.org/content/repositories/snapshots/ as snapshot-repository to test it.

Show
Robert Scholte added a comment - 08/Feb/12 12:43 PM No, but this issue will be fixed with this version once released. You can see at the Jira versions tab of the plugin when every version was released. I've deployed a snapshot, you can use https://repository.apache.org/content/repositories/snapshots/ as snapshot-repository to test it.
Hide
Permalink
Dennis Lundberg added a comment - 08/Feb/12 12:45 PM

No, it's not released yet.

There was one other potential regression that was posted on the user list. I want to see that through, before starting the release process.

Show
Dennis Lundberg added a comment - 08/Feb/12 12:45 PM No, it's not released yet. There was one other potential regression that was posted on the user list. I want to see that through, before starting the release process.

People

  • Assignee:
    Dennis Lundberg
    Reporter:
    Jan Ruzicka
Vote (0)
Watch (2)

Dates

  • Created:
    06/Feb/12 10:11 AM
    Updated:
    12/Feb/12 3:55 PM
    Resolved:
    07/Feb/12 12:23 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.