JDK-8241640 : Javadoc error if unnamed module depends on named module
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 14
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2020-03-25
  • Updated: 2020-05-18
  • Resolved: 2020-04-03
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Windows 10.0.18363.720
openjdk 14 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)

A DESCRIPTION OF THE PROBLEM :
1. Extract testcase from https://issues.apache.org/jira/browse/MJAVADOC-645
2. Run "mvn clean package"
3. Build fails with:

Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (attach-javadocs) on project module2: MavenReportException: Error while generating Javadoc: 
Exit code: 1 - javadoc: error - The code being documented uses packages in the unnamed module, but the packages defined in http://nexus.sonatype.org/oss-repository-hosting.html/root/module1/apidocs/ are in named modules.

Command line was: cmd.exe /X /C ""C:\Program Files\Java\jdk-14+36-1461\bin\javadoc.exe" @options @packages"

Refer to the generated Javadoc files in 'C:\Users\Gili\Documents\3rdparty\javadoc-jar-mixing-named-and-unnamed-extending-sonatype\module2\target\apidocs' dir.

4. In spite of the error, the Javadoc tool outputs files.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
1. The Javadoc tool should output files and succeed, or fail without writing any files.
2. The Javadoc tool should allow mixing named and unnamed modules, especially if the unnamed module contains an Automatic-Module-Name MANIFEST.MF entry.
3. The Javadoc tool should suggest adding Automatic-Module-Name MANIFEST.MF entries to unnamed modules if they are not present.

FREQUENCY : always



Comments
Closing as duplicate of JDK-8240169 which has been widened to include the case of a non-modular package linking to modular API docs. I also tested the provided test case with the proposed fix for JDK-8240169 to confirm it fixes the error.
03-04-2020

This is similar to JDK-8240169 which is currently being looked into.
26-03-2020