Maven PMD Plugin
  1. Maven PMD Plugin
  2. MPMD-142

PMD Report for maven site fails with ClassCastException

    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
    • Number of attachments :
      1

      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)
      

        Activity

        Hide
        Jordan Hein added a comment -

        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 - 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
        Robert Scholte added a comment -

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

        Show
        Robert Scholte added a comment - Added IT to prevent regression (although this is not a Maven 3 issue) rev. 1241574
        Hide
        Jan Ruzicka added a comment -

        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 - 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
        Robert Scholte added a comment -

        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 - 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
        Dennis Lundberg added a comment -

        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 - 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
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: