jira-importer commented on issue #852: URL: https://github.com/apache/maven-javadoc-plugin/issues/852#issuecomment-2957357616
**[Gili](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=cowwoc)** commented I got it working (export-to-testcase.zip) but I think it's worth having a follow-up discussion about how (and why) this works: * If the root project inherits from org.sonatype.oss:oss-parent:9 then the plugin logs this extra step "[DEBUG] Added Javadoc offline link: http://nexus.sonatype.org/oss-repository-hosting.html/root/module1/apidocs for the module: testcase:module1:jar:1.0-SNAPSHOT" * This causes the plugin to add "--add-modules module1" to the "options" file. * This leads to us getting a new error message: "package module1 is declared in module module1, which does not export it to the unnamed module". * To fix this, I had to add: ```java <additionalOptions> <option>--add-exports</option> <option>module1/module1=ALL-UNNAMED</option> </additionalOptions> ``` to module2's plugin configuration. I want to update the FAQ with more examples so I need your help in understand what is going on. Open questions: * Why aren't we always adding "--add-modules module1"? I think we should respect "export...to" in the presence of at least one module, even if no offline links are present. Is this a bug? * Are the above options the correct way to solve this problem? Meaning, are we forced to export the package into the unnamed module space? Couldn't we use "--patch-module" to convert module2 into a named module and in so doing (1) avoid having the user needing to declare \<additionalOptional> (2) avoid exposing a package to modules that should not see it? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
