mavenmaven-3maven-pluginmaven-site-plugin

java.lang.NoSuchMethodError: 'void org.apache.maven.doxia.sink.Sink.verbatim()'


Here is the reporting part of my pom.xml for running the command mvn site

  <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <outputDirectory>target/javadoc</outputDirectory>
                    <reportOutputDirectory>target/javadoc</reportOutputDirectory>
                    <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.pitest</groupId>
                <artifactId>pitest-maven</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>3.6.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>3.5.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <outputDirectory>target/reports/checkstyle</outputDirectory>
                    <configLocation>google_checks.xml</configLocation>
                    <outputFileFormat>xml</outputFileFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>4.8.6.5</version>
                <configuration>
                    <outputDirectory>target/reports/findbugs</outputDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <version>11.1.0</version>
                <configuration>
                    <assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
                    <formats>
                        <format>html</format>
                    </formats>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>taglist-maven-plugin</artifactId>
                <version>3.2.1</version>
                <configuration>
                    <tagListOptions>
                        <tagClasses>
                            <tagClass>
                                <tags>
                                    <tag>
                                        <matchString>todo</matchString>
                                        <matchType>ignoreCase</matchType>
                                    </tag>
                                </tags>
                            </tagClass>
                        </tagClasses>
                    </tagListOptions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.8.0</version>
            </plugin>
        </plugins>
    </reporting>

When running mvn site command, I face many:

An issue has occurred with maven-project-info-reports-plugin:3.8.0:dependency-info report, skipping LinkageError 'void org.apache.maven.doxia.sink.Sink.verbatim()', please report an issue to Maven dev team.
java.lang.NoSuchMethodError: 'void org.apache.maven.doxia.sink.Sink.verbatim()'

This stacktrace is observed with several plugins. I am going to use [plugin1, plugin2, pluginN] as the rest of the stacktrace is the same:

 An issue has occurred with [maven-surefire-report-plugin:3.5.2:report, maven-project-info-reports-plugin:3.8.0:ci-management, maven-project-info-reports-plugin:3.8.0:dependency-info, maven-project-info-reports-plugin:3.8.0:issue-management, maven-project-info-reports-plugin:3.8.0:licenses, maven-project-info-reports-plugin:3.8.0:scm] report, skipping LinkageError 'void org.apache.maven.doxia.sink.Sink.verbatim()', please report an issue to Maven dev team.
java.lang.NoSuchMethodError: 'void org.apache.maven.doxia.sink.Sink.verbatim()'
    at org.apache.maven.reporting.AbstractMavenReportRenderer.verbatimText (AbstractMavenReportRenderer.java:346)
    at org.apache.maven.report.projectinfo.DependencyInformationReport$DependencyInformationRenderer.renderDependencyInfo (DependencyInformationReport.java:217)
    at org.apache.maven.report.projectinfo.DependencyInformationReport$DependencyInformationRenderer.renderMavenDependencyCoordinates (DependencyInformationReport.java:170)
    at org.apache.maven.report.projectinfo.DependencyInformationReport$DependencyInformationRenderer.renderBody (DependencyInformationReport.java:137)
    at org.apache.maven.reporting.AbstractMavenReportRenderer.render (AbstractMavenReportRenderer.java:76)
    at org.apache.maven.report.projectinfo.DependencyInformationReport.executeReport (DependencyInformationReport.java:87)
    at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:358)
    at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:226)
    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:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke (Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)

I tried changing version of the site plugin, of java jdk versions, of maven, but no luck, always getting this.

It also mentioned "please report an issue to Maven dev team" but there is no way to open a GitHub issue, or to send a mail.

May I ask how to fix this?


Solution

  • I filed a bug on the Maven Project Info Reports Plugin which was for me the source of the problem but I was told that the fix was to update the site plugin.

    https://issues.apache.org/jira/browse/MPIR-471

    Can you try this to see if it fixes your issue too: Add to the <plugins> sub-section of <build> section in the POM.

    <plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-site-plugin</artifactId>
     <version>3.21.0</version>
    </plugin>