Maven Changes Plugin
  1. Maven Changes Plugin
  2. MCHANGES-88

NoSuchMethodError with maven 2.0.8 when generating changes-report

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-3
    • Fix Version/s: 2.0
    • Component/s: changes.xml
    • Labels:
      None
    • Environment:
    • Number of attachments :
      7

      Description

      I create a simple maven2 project, but when i call
      mvn -X -e changes:changes-report

      I get an error (full log in attachment)

      java.lang.NoSuchMethodError: org.apache.maven.doxia.siterenderer.Renderer.createSink(Ljava/io/File;Ljava/lang/String;)Lorg/apache/maven/doxia/siterenderer/sink/SiteRendererSink;
      at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:63)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)

      1. AbstractChangesReport.java
        7 kB
        Niall Pemberton
      2. changes.log
        29 kB
        Benjamin Bentmann
      3. error.log
        27 kB
        Julien Graglia
      4. MCHANGES-88-Fix-NoSuchMethodError.patch
        6 kB
        Niall Pemberton
      5. pom.xml
        1 kB
        Julien Graglia
      6. site.log
        41 kB
        Benjamin Bentmann

        Issue Links

          Activity

          Hide
          Dennis Lundberg added a comment -

          Confirming this on Windows as well with maven-site-plugin 2.0-beta-6.

          Show
          Dennis Lundberg added a comment - Confirming this on Windows as well with maven-site-plugin 2.0-beta-6.
          Hide
          Benjamin Bentmann added a comment - - edited

          Quite funny, reports generation works when run by the Site plugin. I attached a minimal test project and two debug logs from "mvn site" and "mvn changes:changes-report", maybe a diff on these helps.

          The maven-changes-plugin directly depends on
          o maven-reporting-impl:2.0.4
          o doxia-site-renderer:1.0-alpha-9
          but the maven-reporting-impl:2.0.4 itself was compiled against
          o doxia-site-renderer:1.0-alpha-7
          and the method org.apache.maven.doxia.siterenderer.Renderer.createSink() does not exist any more in doxia-site-renderer:1.0-alpha-9.

          Show
          Benjamin Bentmann added a comment - - edited Quite funny, reports generation works when run by the Site plugin. I attached a minimal test project and two debug logs from "mvn site" and "mvn changes:changes-report", maybe a diff on these helps. The maven-changes-plugin directly depends on o maven-reporting-impl:2.0.4 o doxia-site-renderer:1.0-alpha-9 but the maven-reporting-impl:2.0.4 itself was compiled against o doxia-site-renderer:1.0-alpha-7 and the method org.apache.maven.doxia.siterenderer.Renderer.createSink() does not exist any more in doxia-site-renderer:1.0-alpha-9.
          Hide
          Niall Pemberton added a comment - - edited

          The problem seems to be that the createSink(File, String) method was removed from org.apache.maven.doxia.siterenderer.Renderer in revision 385559:

          I checked out the "Project Info" reports to see if they could be run individually as well - which they can and looking at the maven-project-info-reports-plugin - it has its own execute() method in AbstractProjectInfoReport which all the reports in that plugin use.

          I'm attaching a patch which copies the AbstractProjectInfoReport into the changes plugin, renames it (to AbstractChangesReport) and modifies the changes and jira reports (confirmed this has the same issue) to use that abstract implementation. This seems resolves the issue.

          Running the JIRA report failed if the target directory didn't exist - so I also added code to fix that.

          In case my patch for the copied/modified AbstractProjectInfoReport doesn't work properly, I'm attaching a full copy of it as well (btw I copied the last 2.0.1 release version of AbstractProjectInfoReport)

          Show
          Niall Pemberton added a comment - - edited The problem seems to be that the createSink(File, String) method was removed from org.apache.maven.doxia.siterenderer.Renderer in revision 385559: http://tinyurl.com/2wh8lr I checked out the "Project Info" reports to see if they could be run individually as well - which they can and looking at the maven-project-info-reports-plugin - it has its own execute() method in AbstractProjectInfoReport which all the reports in that plugin use. I'm attaching a patch which copies the AbstractProjectInfoReport into the changes plugin, renames it (to AbstractChangesReport) and modifies the changes and jira reports (confirmed this has the same issue) to use that abstract implementation. This seems resolves the issue. Running the JIRA report failed if the target directory didn't exist - so I also added code to fix that. In case my patch for the copied/modified AbstractProjectInfoReport doesn't work properly, I'm attaching a full copy of it as well (btw I copied the last 2.0.1 release version of AbstractProjectInfoReport)
          Hide
          Dennis Lundberg added a comment -

          So if I understand this correctly, we really need a version maven-reporting-impl that uses the same version of doxia as this plugin does. In this case that is 1.0-alpha-9.

          Until that is available we need to work around this problem. Copy the execute() method from maven-reporting-impl and modify it so that it only uses doxia-methods that are available in 1.0-alpha-9. This has already been done in MPIR, so an alternative is to copy it from there.

          Show
          Dennis Lundberg added a comment - So if I understand this correctly, we really need a version maven-reporting-impl that uses the same version of doxia as this plugin does. In this case that is 1.0-alpha-9. Until that is available we need to work around this problem. Copy the execute() method from maven-reporting-impl and modify it so that it only uses doxia-methods that are available in 1.0-alpha-9. This has already been done in MPIR, so an alternative is to copy it from there.
          Hide
          Niall Pemberton added a comment -

          Even when you get a compatible verson of maven-reporting-impl released it is still going to throw an exception though - just it will be a MojoExecutionException saying "Reporting mojo's can only be called from ReportDocumentRender" rather than a NoSuchMethodError.

          http://svn.apache.org/repos/asf/maven/shared/trunk/maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java

          If thats considered correct maven practice and what this plugin will do once you get a maven-reporting-impl release then you may as well just implement an execute method that throws that exception now.

          But if however the report should work standalone though, then copying MPIR is the solution.

          Show
          Niall Pemberton added a comment - Even when you get a compatible verson of maven-reporting-impl released it is still going to throw an exception though - just it will be a MojoExecutionException saying "Reporting mojo's can only be called from ReportDocumentRender" rather than a NoSuchMethodError. http://svn.apache.org/repos/asf/maven/shared/trunk/maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java If thats considered correct maven practice and what this plugin will do once you get a maven-reporting-impl release then you may as well just implement an execute method that throws that exception now. But if however the report should work standalone though, then copying MPIR is the solution.
          Hide
          Vincent Siveton added a comment -

          I fixed recently MNG-3388 so debug shoud be better specially in the realm.

          The problem seems to come from MavenArtifactFilterManager wich excludes doxia-sink-api. We have the same problem in maven-pdf-plugin.

          Show
          Vincent Siveton added a comment - I fixed recently MNG-3388 so debug shoud be better specially in the realm. The problem seems to come from MavenArtifactFilterManager wich excludes doxia-sink-api. We have the same problem in maven-pdf-plugin.
          Hide
          Dennis Lundberg added a comment -

          I committed Niall's patch in r620284. Thanks!

          I left out the part for AbstractJiraDownloader though, as I was not able to reproduce it. Can you please open a separate issue for that, with instructions on how to reproduce it.

          Show
          Dennis Lundberg added a comment - I committed Niall's patch in r620284. Thanks! I left out the part for AbstractJiraDownloader though, as I was not able to reproduce it. Can you please open a separate issue for that, with instructions on how to reproduce it.
          Hide
          Niall Pemberton added a comment -

          OK I've created MCHANGES-100

          Show
          Niall Pemberton added a comment - OK I've created MCHANGES-100

            People

            • Assignee:
              Dennis Lundberg
              Reporter:
              Julien Graglia
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: