Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinkageError throws Warning and does not create a valid report #39

Open
Bukama opened this issue Aug 19, 2024 · 9 comments
Open

LinkageError throws Warning and does not create a valid report #39

Bukama opened this issue Aug 19, 2024 · 9 comments
Labels

Comments

@Bukama
Copy link

Bukama commented Aug 19, 2024

We updated the Maven-plugins (compile, jar, site, etc.) of one of our projects. This project is the only one that also uses the jdepend-maven-plugin (can't tell you why). The build then threw a warning and could not generate a proper JDepend report.

The project had the following dependency in the report section

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jdepend-maven-plugin</artifactId>
        <version>2.0</version>
      </plugin> 

The warning is related to DOXIA so maybe to the site-plugin which is used in version 4.0.0-M14 (in which Doxia is updated for Maven 4 etc). Issues doesn't seem to pop with site-plugin 3.12.1

jepend

[INFO] <<< jdepend:2.0:generate (default-site) < compile @ XXX <<<
[INFO]
[INFO] 'compile' forked phase execution for jdepend-maven-plugin:generate report preparation done
[INFO] Detected 2 reports for jdepend-maven-plugin:2.0: generate-no-fork, generate
[INFO] Analysis cache created
[INFO] Fork Value is true
[INFO] Done SpotBugs Analysis....
[INFO] Skipping org.apache.maven.plugins:maven-surefire-report-plugin:3.2.5:failsafe-report-only report
[INFO] Skipping JaCoCo execution due to missing execution data file.
[INFO] Skipping org.jacoco:jacoco-maven-plugin:0.8.7:report-integration report
[INFO] Relativizing site links with respect to localized project URL: XXXX 
[INFO] Rendering content with org.apache.maven.skins:maven-fluido-skin:jar:2.0.0-M8 skin
[INFO] Skipped "Source Xref" report (maven-jxr-plugin:3.3.2:jxr-no-fork), file "xref/index.html" already exists.
[INFO] Skipped "Test Source Xref" report (maven-jxr-plugin:3.3.2:test-jxr-no-fork), file "xref-test/index.html" already exists.
[INFO] Skipped "JDepend" report (jdepend-maven-plugin:2.0:generate), file "jdepend-report.html" already exists.
[INFO] Rendering 21 report documents
[INFO] Generating "Checkstyle" report    --- maven-checkstyle-plugin:3.3.1:checkstyle
[INFO] Generating "CPD" report           --- maven-pmd-plugin:3.14.0:cpd
[INFO] Generating "PMD" report           --- maven-pmd-plugin:3.14.0:pmd
[INFO] Generating "Javadoc" report       --- maven-javadoc-plugin:3.6.3:javadoc
[INFO] Configuration changed, re-generating javadoc.
[INFO] Generating "SpotBugs" report      --- spotbugs-maven-plugin:4.8.5.0:spotbugs
[INFO] Generating "Dependencies" report  --- maven-project-info-reports-plugin:3.5.0:dependencies
[INFO] Generating "Dependency Information" report --- maven-project-info-reports-plugin:3.5.0:dependency-info
[INFO] Generating "Dependency Management" report --- maven-project-info-reports-plugin:3.5.0:dependency-management
[INFO] Generating "Distribution Management" report --- maven-project-info-reports-plugin:3.5.0:distribution-management
[INFO] Generating "About" report         --- maven-project-info-reports-plugin:3.5.0:index
[INFO] Generating "Issue Management" report --- maven-project-info-reports-plugin:3.5.0:issue-management
[INFO] Generating "Plugin Management" report --- maven-project-info-reports-plugin:3.5.0:plugin-management
[INFO] Generating "Plugins" report       --- maven-project-info-reports-plugin:3.5.0:plugins
[INFO] Generating "Summary" report       --- maven-project-info-reports-plugin:3.5.0:summary
[INFO] Generating "Source Xref" report   --- maven-jxr-plugin:3.3.2:jxr
[INFO] Generating "Test Source Xref" report --- maven-jxr-plugin:3.3.2:test-jxr
[INFO] Generating "Surefire" report      --- maven-surefire-report-plugin:3.2.5:report
[INFO] Generating "JaCoCo" report        --- jacoco-maven-plugin:0.8.7:report
[INFO] Loading execution data file XXXX\target\jacoco.exec
[INFO] Analyzed bundle 'CommonArch-Test' with 31 classes
[INFO] Generating "JDepend" report       --- jdepend-maven-plugin:2.0:generate-no-fork
[WARNING] An issue has occurred with jdepend-maven-plugin:2.0:generate-no-fork report, skipping LinkageError Method org/codehaus/mojo/jdepend/JDependNoForkMojo.generate(Lorg/apache/maven/doxia/sink/Sink;Ljava/util/Locale;)V is abstract, please report an issue to Maven dev team.
java.lang.AbstractMethodError: Method org/codehaus/mojo/jdepend/JDependNoForkMojo.generate(Lorg/apache/maven/doxia/sink/Sink;Ljava/util/Locale;)V is abstract
    at org.codehaus.mojo.jdepend.JDependNoForkMojo.generate (JDependNoForkMojo.java)
    at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:201)
    at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render (DefaultSiteRenderer.java:300)
    at org.apache.maven.plugins.site.render.SiteMojo.renderNonDoxiaDocuments (SiteMojo.java:281)
    at org.apache.maven.plugins.site.render.SiteMojo.renderLocale (SiteMojo.java:146)
    at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:111)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160)
    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:910)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
  

Not very surprising that the JDEpend-Report is not generated correctly with that warning

jdepend_report_fehlerhaft

@Bukama
Copy link
Author

Bukama commented Aug 19, 2024

To be honest I'm not sure if this is a general Doxia/Site plugin issue, but after removing the JDepend Report-Dependency everything worked fine and we don't have any issues in all our other projects (which uses 4.0.0-Mx for a longer time but no JDepend. As the Mojo that throws the error is an JDepend Mojo according to message/stacktrace I decided to post it here (and after a quick question in Maven Slack)

@ottlinger
Copy link

I ran into a similar problem within apache-tentacles as well after I updated to maven-site-plugin 3.12.1 to 3.20.0:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.20.0:site (default-site) on project apache-tentacles: Failed to render site: Error generating jdepend-maven-plugin:2.0:generate-no-fork report: UndeclaredThrowableException: InvocationTargetException: Method org/codehaus/mojo/jdepend/JDependNoForkMojo.generate(Lorg/apache/maven/doxia/sink/Sink;Ljava/util/Locale;)V is abstract -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.20.0:site (default-site) on project apache-tentacles: Failed to render site
.....

Caused by: org.apache.maven.doxia.siterenderer.RendererException: Error generating jdepend-maven-plugin:2.0:generate-no-fork report
.....

Caused by: java.lang.AbstractMethodError: Method org/codehaus/mojo/jdepend/JDependNoForkMojo.generate(Lorg/apache/maven/doxia/sink/Sink;Ljava/util/Locale;)V is abstract
    at org.codehaus.mojo.jdepend.JDependNoForkMojo.generate (JDependNoForkMojo.java)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at com.gradle.maven.cache.extension.h.b.lambda$createProxy$0 (SourceFile:82)

@slachiewicz Is the problem related to jdepend or a configuration issue? Thanks

@ottlinger
Copy link

@Bukama is the problem fixed with the current 2.1-SNAPSHOT? If so maybe a release can be done as the current situation (with v2.0) yields an empty report or a broken build. Thanks.

@Bukama
Copy link
Author

Bukama commented Sep 9, 2024

@Bukama is the problem fixed with the current 2.1-SNAPSHOT? If so maybe a release can be done as the current situation (with v2.0) yields an empty report or a broken build. Thanks.

Hey, sadly I can't check as the SNAPSHOT is not available via Maven Central and cloning Github project is blocked by our security here :/ . As only dependencies from Maven Central and verified by our comapnies Nexus IQ servers can be used - is it possible to release a beta/RC or so? I have seen there are tags for beta versions of former versions.

@ottlinger
Copy link

Short status update - the current version 77b8431 2.1-SNAPSHOT does not emit above warning and a report is generated again.
In the case of Apache Tentacles it looks a bit broken but is at least not empty as before. It seems as if tables are not generated properly:
Screenshot from 2024-09-22 00-16-20

Would it be possible to release the current version to get more feedback from other users/downstream projects? Thanks

@olamy
Copy link
Member

olamy commented Sep 24, 2024

release 2.1 done.
But the code probably needs to be updated to last doxia/site plugin changes though

@ottlinger
Copy link

ottlinger commented Sep 24, 2024

@olamy thanks for the help - this allowed inclusion of the plugin in Apache Tentacles.

Does it make sense to file a new issue concerning the/above layout problems or is this related to the skin and not caused by the jdepend plugin? As I redeployed the webpage the current report is available here.

As the skin renders tables properly (e.g. TagListPlugin-Report) I had the impression that the plugin causes the layout issues ....

@ottlinger
Copy link

@Bukama if the problem is fixed for you with version 2.1 of the plugin this issue can be closed. I opened a new ticket for the layout problems: #43 - thanks

@Bukama
Copy link
Author

Bukama commented Sep 30, 2024

@ottlinger Sorry for my late response. I saw the release last week, but didn't had time to check the version.

The result with 2.1: The build works again, but the plugin throws following lines (without further text) multiple times during the build:

[INFO] Generating "JDepend" report --- jdepend-maven-plugin:2.1:generate

Unknown constant: 18

Unknown constant: 18

Unknown constant: 18

Unknown constant: 18

Unknown constant: 18

Sometimes the lines are "only" printed a few times, sometimes it's about 20 times. I can't find out what's the source of that. I doub't that it's a constant in the project which is defined with this value ( private static final int COUNT_N1 = 18;). Maybe some Java version (Java 8 = 1.8 ? Build was run on Java 8. Maybe you want to have a quick look at it to decide if that should be part of an independend issue. The base issue here (LinkageError) was fixed with 2.1 - thank you for that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants