[Build] Support property: maven.compiler.release for building BK with higher version JDK
Motivation
With this feature, the compiler will detect and generate an error when using APIs that don't exist in previous releases of Java SE in advance.
Changes
Add property: maven.compiler.release
Master Issue: #4089
rerun failure checks
Failure is about maven-javadoc-plugin, but i didn't change it, seems to be not related?
Failure is about maven-javadoc-plugin, but i didn't change it, seems to be not related?
seems related, checking on local
I could reproduce the CI failure on local, it is all about groovy, it could be fixed by removing "-T 1C" which indicates: can't run in parallel, don't know why..
I also tried upgrading to the latest groovy 3.0.19 for 3, it also failed unless i remove "-T 1C"
any thought?
Let me explain more about this PR. (I'm using JDK 17 to build on local)
First of all, only with <maven.compiler.release>${release.target}</maven.compiler.release>, during PR Validation stage, it would fail as following
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (attach-javadocs) on project bookkeeper-stats-api: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 4 - Loading source files for package org.apache.bookkeeper.stats...
[ERROR] Constructing Javadoc information...
[ERROR] error: fatal error encountered: java.lang.AssertionError
[ERROR] error: Please file a bug against the javadoc tool via the Java bug reporting page
[ERROR] (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com)
[ERROR] for duplicates. Include error messages and the following diagnostic in your report. Thank you.
[ERROR] java.lang.AssertionError
[ERROR] at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:155)
[ERROR] at jdk.compiler/com.sun.tools.javac.util.Assert.checkNonNull(Assert.java:62)
[ERROR] at jdk.compiler/com.sun.tools.javac.comp.Modules.allModules(Modules.java:1216)
[ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.ElementsTable.findModuleOfPackageName(ElementsTable.java:857)
[ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.ElementsTable.addPackagesFromLocations(ElementsTable.java:537)
[ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.ElementsTable.computeSubpackages(ElementsTable.java:510)
[ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.ElementsTable.computeSpecifiedPackages(ElementsTable.java:747)
[ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.ElementsTable.analyze(ElementsTable.java:347)
[ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.JavadocTool.getEnvironment(JavadocTool.java:220)
[ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.Start.parseAndExecute(Start.java:546)
[ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:393)
[ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:342)
[ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
[ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)
[ERROR] 2 errors
[ERROR]
[ERROR] Command line was: /usr/local/Cellar/openjdk@17/17.0.7/libexec/openjdk.jdk/Contents/Home/bin/javadoc @options
:maven-javadoc-plugin
Then from this issue: https://bugs.openjdk.org/browse/JDK-8193030, the last comment gives me a hint. That's why I removed all <subpackages> tag.
In the meantime, I checked the maven-javadoc-plugin, as tag <packages> in <group> does the same thing, so I was double confirmed it is safe to be removed.
:maven-javadoc-plugin
Then from this issue: https://bugs.openjdk.org/browse/JDK-8193030, the last comment gives me a hint. That's why I removed all tag.
In the meantime, I checked the maven-javadoc-plugin, as tag in does the same thing, so I was double confirmed it is safe to be removed.
After these two issues got fixed, here comes to the 3rd one:
[ERROR] Constructing Javadoc information...
[ERROR] /Users/reid.chen/Shopee/bookkeeper/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/conf/ConfigKeyGroup.java:59: error: cannot find symbol
[ERROR] public static ConfigKeyGroupBuilder builder(String name) {
[ERROR] ^
[ERROR] symbol: class ConfigKeyGroupBuilder
[ERROR] location: class ConfigKeyGroup
[ERROR] /Users/reid.chen/Shopee/bookkeeper/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/conf/ConfigKey.java:64: error: cannot find symbol
[ERROR] public static ConfigKeyBuilder builder(String name) {
[ERROR] ^
[ERROR] symbol: class ConfigKeyBuilder
[ERROR] location: class ConfigKey
[ERROR] 2 errors
[ERROR]
[ERROR] Command line was: /usr/local/Cellar/openjdk@17/17.0.7/libexec/openjdk.jdk/Contents/Home/bin/javadoc @options @argfile
As this answer suggests, that's why I added public static class XXXBuilder {}. And it passed
:maven-javadoc-plugin
Then from this issue: https://bugs.openjdk.org/browse/JDK-8193030, the last comment gives me a hint. That's why I removed all tag. In the meantime, I checked the maven-javadoc-plugin, as tag in does the same thing, so I was double confirmed it is safe to be removed.
After these two issues got fixed, here comes to the 3rd one:
[ERROR] Constructing Javadoc information... [ERROR] /Users/reid.chen/Shopee/bookkeeper/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/conf/ConfigKeyGroup.java:59: error: cannot find symbol [ERROR] public static ConfigKeyGroupBuilder builder(String name) { [ERROR] ^ [ERROR] symbol: class ConfigKeyGroupBuilder [ERROR] location: class ConfigKeyGroup [ERROR] /Users/reid.chen/Shopee/bookkeeper/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/conf/ConfigKey.java:64: error: cannot find symbol [ERROR] public static ConfigKeyBuilder builder(String name) { [ERROR] ^ [ERROR] symbol: class ConfigKeyBuilder [ERROR] location: class ConfigKey [ERROR] 2 errors [ERROR] [ERROR] Command line was: /usr/local/Cellar/openjdk@17/17.0.7/libexec/openjdk.jdk/Contents/Home/bin/javadoc @options @argfileAs this answer suggests, that's why I added
public static class XXXBuilder {}. And it passed
Final issue is this comment
-T 1C
with "-T 1C" 100% failure
without "-T 1C" 100% success
@Reidddddd Closed by no update, feel free to reopen it if you still want to work on it.