History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: MCHANGES-88
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dennis Lundberg
Reporter: Julien Graglia
Votes: 2
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Maven 2.x Changes Plugin

NoSuchMethodError with maven 2.0.8 when generating changes-report

Created: 13/Dec/07 03:23 AM   Updated: 01/Apr/08 03:52 PM
Component/s: changes-report
Affects Version/s: 2.0-beta-3
Fix Version/s: 2.0

Time Tracking:
Not Specified

File Attachments: 1. Java Source File AbstractChangesReport.java (7 kb)
2. Text File changes.log (29 kb)
3. Zip Archive changes.zip (1 kb)
4. Text File error.log (27 kb)
5. Text File MCHANGES-88-Fix-NoSuchMethodError.patch (6 kb)
6. XML File pom.xml (1 kb)
7. Text File site.log (41 kb)

Environment:
julien@jgr-pc:/opt/nc/workspace/test_maven$ mvn -version
Maven version: 2.0.8
Java version: 1.6.0_03
OS name: "linux" version: "2.6.18-5-686" arch: "i386" Family: "unix"
Issue Links:
Duplicate
 
Related


 Description  « Hide
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)



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Dennis Lundberg - 14/Dec/07 12:00 PM
Confirming this on Windows as well with maven-site-plugin 2.0-beta-6.

Benjamin Bentmann - 06/Jan/08 10:45 AM - 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.


Niall Pemberton - 05/Feb/08 08:17 PM - 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)


Dennis Lundberg - 06/Feb/08 04:41 PM
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.


Niall Pemberton - 06/Feb/08 06:08 PM
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.


Vincent Siveton - 06/Feb/08 08:32 PM
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.


Dennis Lundberg - 10/Feb/08 07:30 AM
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.


Niall Pemberton - 11/Feb/08 06:56 AM
OK I've created MCHANGES-100