[
https://issues.apache.org/jira/browse/MJAVADOC-620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16976526#comment-16976526
]
Frank Wienberg commented on MJAVADOC-620:
-----------------------------------------
We ran into a similar issue and debugged maven-javadoc-plugin's classpath
assembly.
It looks like when using the Plexus locationManager
[https://github.com/apache/maven-javadoc-plugin/blob/master/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java#L5141]
{{ ResolvePathsResult<File> result = locationManager.resolvePaths( request );}}
the request fails for JARs that do not have an automatic module name and whose
filename contains tokens with only numbers, like unfortunately any Maven-built
JAR will.
The module name guessing heuristic replaces all dashes by dots, then splits the
result at dots. Every part has to be a Java identifier, which "1" or "42"
obviously is not. The heuristic then throws a FindException.
maven-javadoc-plugin does not handle such errors gracefully, but simply ignores
all JARs for which no valid module name can be resolved.
Since non-module JARs should be handled as before, a fix would be to add all
JARs for which locationManager returns some error to the classpath
nevertheless. At least those that caused a FindException.
If you want, I could provide a PR for this fix.
> Maven Javadoc Plugin fails to resolve the dependencies when used with Java 11
> -----------------------------------------------------------------------------
>
> Key: MJAVADOC-620
> URL: https://issues.apache.org/jira/browse/MJAVADOC-620
> Project: Maven Javadoc Plugin
> Issue Type: Bug
> Components: javadoc
> Affects Versions: 3.1.0, 3.1.1
> Environment: Mageia Linux 7, AdoptOpenJDK 11.0.1
> Reporter: Julien Gouesse
> Priority: Major
> Attachments: BuildMeFirst.zip, MavenTest.zip, ThenBuildThisSite.zip
>
>
> Maven Javadoc Plugin fails to resolve the dependencies that are inherited by
> all sub-modules in the parent pom file and the dependencies specific to some
> sub-modules if and only if it's used with Java 11 whereas it works flawlessly
> with Java 8. This bug is reproducible with this project:
> [https://jogamp.org/cgit/ardor3d.git/tree/]
> Enter "mvn site" and you'll get the following error message:
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-site-plugin:3.7.1:site (default-site) on
> project ardor3d: Error generating maven-javadoc-plugin:3.1.1:aggregate
> report: [ERROR] Exit code: 1 -
> Ardor3D/ardor3d-swt/src/test/java/com/ardor3d/input/swt/TestSwtMouseWrapper.java:23:
> error: package org.eclipse.swt.events does not exist
> Note that "mvn install" works with Java 11, this problem of dependency
> management only occurs while generating the Java API documentation with Java
> 11.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)