Robert,

This is supposed to be allowed.

See CSR:    JDK-8222396: Allow "--add-modules ALL-MODULE-PATH" when compiling in the context of an automatic module
https://bugs.openjdk.java.net/browse/JDK-8222396

This was fixed in
https://bugs.openjdk.java.net/browse/JDK-8220702
and should be in JDK 13, build11 onwards.

From the JDK 13 source code for javac, the error message in the resource file is:

compiler.err.addmods.all.module.path.invalid=\
    --add-modules ALL-MODULE-PATH can only be used when compiling the unnamed module or \
    when compiling in the context of an automatic module

So, I'm wondering if you are using a recent build of JDK 13?

-- Jon


On 07/23/2019 12:39 PM, Robert Scholte wrote:
Recently we've started adding Java 13 to our matrix of Java versions when testing plugins. It seems like something has changed, because a set of integration tests fails with the following message:

Exit code: 1 - error: --add-modules ALL-MODULE-PATH can only be used when compiling the unnamed module

The set belongs to MJAVADOC-568[1], which handles artifacts that get a name via the Manifest attribute Automatic-Module-Name. When creating JavaDoc for such code, using the '--add-modules ALL-MODULE-PATH' was the way to get the correct JavaDoc. This used to work up to Java 12.

My question: is this an intended change and what's the reasoning behind it?
And of course in the end: what's the preferred solution?

For the integration tests you can have a look at github[3], I can provide the results of the ITs when required.

thanks,
Robert

[1] https://issues.apache.org/jira/browse/MJAVADOC-568
[2] https://github.com/apache/maven-javadoc-plugin/blob/maven-javadoc-plugin-3.1.1/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java#L5085-L5090 [3] https://github.com/apache/maven-javadoc-plugin/tree/maven-javadoc-plugin-3.1.1/src/it/projects

Reply via email to