[ https://issues.apache.org/jira/browse/MCOMPILER-608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17924139#comment-17924139 ]
ASF GitHub Bot commented on MCOMPILER-608: ------------------------------------------ slawekjaranowski commented on code in PR #275: URL: https://github.com/apache/maven-compiler-plugin/pull/275#discussion_r1943194797 ########## src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java: ########## @@ -1889,7 +1889,9 @@ final String getImplicit() { * @see <a href="https://bugs.openjdk.org/browse/JDK-8318913">JDK-8318913</a> */ private void patchJdkModuleVersion(CompilerResult compilerResult, Set<File> sources) throws MojoExecutionException { - if (compilerResult.isSuccess() && getModuleDeclaration(sources).isPresent()) { + if (compilerResult.isSuccess() + && getModuleDeclaration(sources).isPresent() + && !JavaVersion.JAVA_VERSION.isAtLeast("22")) { Review Comment: Will not detect JDK version used by toolchains, we can use different JDK for compiling than executing project build. > Reproducible builds break compilation on --release 23+ > ------------------------------------------------------- > > Key: MCOMPILER-608 > URL: https://issues.apache.org/jira/browse/MCOMPILER-608 > Project: Maven Compiler Plugin > Issue Type: Bug > Affects Versions: 3.13.0 > Reporter: Josiah Noel > Priority: Major > > As a result of MCOMPILER-542, it seems that when compiling with a release > higher than 22 and the `project.build.outputTimestamp` property set, > compilation fails because of `Unsupported class file major version`. > Since [[JDK-8318913]|https://bugs.openjdk.org/browse/JDK-8318913] was added > to the JDK in 22, would it be sufficient to modify the logic that if the > current JVM is 22+, the ASM transformation should not occur? This can be > achieved with various methods (checking SourceVersion.values(), using > reflection to call Runtime.version() if available, etc.) > > -- This message was sent by Atlassian Jira (v8.20.10#820010)