-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: fix javadoc with Java 9 and later #262
Conversation
Hi @hashar, Thanks for the effort of creating the PR.
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable> Also: the GitHub Action that includes the JavaDoc generation is already running under JDK 11 and works fine. |
hi @CarstenWickner , My local environment is Java 11 and
On GitHub I am guessing the action sets The reason for the error I encounter is, starting with Java 9, the binaries for the JDK and the JRK are now in the same directory and the Maven plugin does not take that in account. My change only refers to Java 8 and Java 11 which are the versions shipped by Debian, but the rule should have been for 8 and 9. Regardless, looking at the plugin code, the issue was MJAVADOC-650 So essentially my change can be dropped and repurposed to update the Maven javadoc plugin from 3.1.0 to 3.3.0 or later. |
The javadoc goal fails with Java 9 or later when JAVA_HOME is not set, the plugin is unable to find the javadoc executable. The issue has been solved in version 3.3.0 of the plugin: https://issues.apache.org/jira/browse/MJAVADOC-650 Update maven-javadoc-plugin to latest release 3.4.0.
2cb3c49
to
3808e16
Compare
Reworked to update |
Thanks @hashar 😄 |
Thank you for doing the extra mile in code reviewing. Will let me update the |
The javadoc goal fails with Java 9 or later when JAVA_HOME is not set, the plugin is unable to find the javadoc executable. The reason is "javadoc" has been moved. The issue has been solved in version 3.3.0 of the plugin: https://issues.apache.org/jira/browse/MJAVADOC-650 Update the maven-javadoc-plugin to latest release 3.4.0. I have done a similar update at: victools/jsonschema-generator#262 Also remove the `source=8` javadoc configuration for https://bugs.openjdk.org/browse/JDK-8212233 The pom targets Java 11. Change-Id: If04cbe2dbdbf9583f154f7c9e1e448e74df2c19d
The javadoc path varies between Java 8 and 11, the Java 8 one having an
extra
jre
directory in the pathname:Java 8:
$ /usr/lib/jvm/java-8-openjdk-amd64/bin/java
-XshowSettings:properties -version 2>&1|grep java.home
java.home = /usr/lib/jvm/java-8-openjdk-amd64/jre
Java 11
$ /usr/lib/jvm/java-11-openjdk-amd64/bin/java
-XshowSettings:properties -version 2>&1|grep java.home
java.home = /usr/lib/jvm/java-11-openjdk-amd64
Set javadocExecutable via Maven profiles which activate based on the JDK
version being used.
That fixes the build under Java 11 when
JAVA_HOME
is not set.