You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jeremy Landis (Jira)" <ji...@apache.org> on 2021/09/06 19:29:00 UTC

[jira] [Commented] (MJAVADOC-586) --add-modules ALL-MODULE-PATH can only be used when compiling the unnamed module

    [ https://issues.apache.org/jira/browse/MJAVADOC-586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17410780#comment-17410780 ] 

Jeremy Landis commented on MJAVADOC-586:
----------------------------------------

[~rfscholte] This still feels like a bug here.  The parameter is provided by maven javadoc plugin in [https://github.com/apache/maven-javadoc-plugin/blob/master/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java] line #5316.  The issue presents itself when automatic module naming is used throughout and classpath is still present.  Per the error, its not unnamed, its named per automatic module naming.  Could a fix be added to not add that flag when automtic module naming is in use?  

 

```java
| |

|if ( mainResolvePathResult != null|

|&& ModuleNameSource.MANIFEST.equals( mainResolvePathResult.getModuleNameSource() ) )|

|{|

|arguments.add( "--add-modules" );|

|arguments.add( "ALL-MODULE-PATH" );|

}

```

Or at very least some way to turn this off?  My use case is that I need to run javadoc plugin during verify stages spefically to enforce clean javadocs during builds before we get to CI.  Only fixes I've seen talk about turning that off during such cycles which defeats the purpose.  Due to this issue, when targetting jdk 11, I have to force <source> and <release> on the javadoc plugin back to 8 in order to work.  That in turn throws warnings like crazy when java 11 constructs used like 'var'.  Perference would be that this actually works and best I can tell, adding of that flag isn't allowed.  We are using jdk 11.0.12 from oracle currently.  Unless something else is going on causing this that is being done wrong, the easiest solution seems to be to add a flag to not add that if not wanted (at least without putting any thought into it).

> --add-modules ALL-MODULE-PATH can only be used when compiling the unnamed module
> --------------------------------------------------------------------------------
>
>                 Key: MJAVADOC-586
>                 URL: https://issues.apache.org/jira/browse/MJAVADOC-586
>             Project: Maven Javadoc Plugin
>          Issue Type: Bug
>          Components: jar
>    Affects Versions: 3.1.0
>         Environment: JDK 13-ea+11
> Maven 3.6.0
>            Reporter: Gili
>            Assignee: Robert Scholte
>            Priority: Major
>         Attachments: javadoc-mojo-requires-module.zip
>
>
> # Extract testcase
>  # Run "mvn clean install javadoc:jar" under JDK 13-ea+11
>  # Build fails with: {{--add-modules ALL-MODULE-PATH can only be used when compiling the unnamed module}}
> This testcase works fine under JDK 12-ea+33.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)