maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MJAVADOC-499) Ignore module-info.java on earlier Java versions
Date Sun, 05 Nov 2017 21:44:00 GMT

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

Stephen Colebourne commented on MJAVADOC-499:
---------------------------------------------

No. The use case is a project with code locked to Java 6 where the build needs to work on
Java 6, 7, 8 and 9. I don't think this is an uneasonable use case - its not fair or right
to force people to install and run Java 9, particularly as it is not a long-term support release.

If the user builds on Java 6, use the Javadoc tool from Java 6. If they build on Java 8, use
the Javadoc tool from Java 8. And if they build on Java 9, use the Javadoc tool from Java
9. A simple and straightforward goal.

The change that is needed is to make the plugin automatically exclude module-info.java when
the version of Javadoc doesn't understand it. The Javadoc tool from Java 8 will never understand
module-info.java, so it should be excluded. The alternative is pretty horrible and pretty
tricky, because the profile has to exclude the file twice, once in the build and once in reporting:
https://github.com/JodaOrg/joda-convert/blob/module-info/pom.xml#L603 

Note that Java 8 is going to last a long time as it is the last "normal" release. So, there
will be lots of projects wanting to have a Java 8 baseline, but also be able to add a module-info
for Java 9 and later. IMO, the compile plugin should also do the same - automatically exclude
module-info.java on versions prior to Java 9. Its too common a use case for just documentation.


> Ignore module-info.java on earlier Java versions
> ------------------------------------------------
>
>                 Key: MJAVADOC-499
>                 URL: https://issues.apache.org/jira/browse/MJAVADOC-499
>             Project: Maven Javadoc Plugin
>          Issue Type: Improvement
>    Affects Versions: 3.0.0-M1
>            Reporter: Stephen Colebourne
>            Assignee: Robert Scholte
>             Fix For: 3.0.0
>
>
> Versions of the javadoc tool prior to Java 9 cannot process `module-info.java`. The plugin
should automatically detect and exclude `module-info.java` if the javadoc tool is Java 8 or
earlier. The alternative (Java version specific profiles) does work, but is very verbose for
something that can never work (thus the plugin should deal with it)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message