Closed hunterpayne closed 10 months ago
We currently depend on org.apache.maven.reporting:maven-reporting-api:3.1.1
which is the latest stable version (newer versions are milestones of version 4).
My guess is that MavenReport
will only be updated to directly depend on org.apache.doxia.sink.Sink
instead of org.codehaus.doxia.sink.Sink
(that extends to interface in the new package) as of maven 4.
Unless I'm missing something, that's only a move we'll do once maven 4 stable is out. And if it's a breaking change with no means to easily maintain compatibility with maven 3, this will have to go in a new major version of this plugin. Then, this would likely mean dropping support for maven 3 as this project is understaffed and I won't have the bandwidth to maintain multiple versions.
I'm seeing this in Maven 3.8.5. With maven-site-plugin 3.12.0. Maven seems to be looking for a generate method whose first argument is of type org.apache.doxia.sink.Sink.
What's weird is that I can't seen to find in the git history when the switch was made. Perhaps I just have something weird with my site setup. Here is the exception I am seeing.
java.lang.AbstractMethodError: Receiver class scala_maven.ScalaDocMojo does not define or inherit an implementation of the resolved method 'abstract void generate(org.apache.maven.doxia.sink.Sink, java.util.Locale)' of interface org.apache.maven.reporting.MavenReport. at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:235) at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render (DefaultSiteRenderer.java:348) at org.apache.maven.plugins.site.render.SiteMojo.renderLocale (SiteMojo.java:194) at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:143) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
Maybe this is a bug in the maven-site-plugin?
It also seems that the sink argument isn't even used in your code. Seems like it would be pretty easy to just duplicate the method for both impls. Its just in one place in the code. No need to maintain 2 versions.
maven-site-plugin:3.12.0
depends on maven-reporting-api:3.1.0
, see https://github.com/apache/maven-site-plugin/blob/maven-site-plugin-3.12.0/pom.xml#L223scala-maven-plugin:3.8.1
depends on maven-reporting-api:3.1.1
, see https://github.com/davidB/scala-maven-plugin/blob/4.8.1/pom.xml#L133Both maven-reporting-api:3.1.0
and maven-reporting-api:3.1.1
contain the interface org.apache.maven.reporting.MavenReport
whose generate
method takes a org.codehaus.doxia.sink.Sink
, NOT a org.apache.doxia.sink.Sink
, see https://github.com/apache/maven-reporting-api/blob/maven-reporting-api-3.1.1/src/main/java/org/apache/maven/reporting/MavenReport.java#L22C8-L22C36
does not define or inherit an implementation of the resolved method 'abstract void generate(org.apache.maven.doxia.sink.Sink, java.util.Locale)' of interface org.apache.maven.reporting.MavenReport.
This means that:
maven-site-plugin
you're using was not compiled against maven-reporting-api
3.1.x but against 4.0.0-Mx instead (meaning it's not 3.12.0 as you claimed)maven-reporting-api:4.0.0-Mx
in the classpathI think it's an issue on your side and not a bug in this plugin.
If you disagree, please provide a reproducer as described here.
I am not developing a maven plugin so I don't understand how this is happening. But it does seem to be in the site-plugin and not your plugin so I'm going to close this ticket. Thank you for your help. I appreciate your work on this project.
org.codehaus.doxia.sink.Sink (and all doxia classes) need to change to org.apache.doxia.sink.Sink This causes the plugin to not work with newer versions of maven which look for org.apache.doxia classes instead of org.codehaus.doxia.