Skip to content

update maven-compiler-plugin configuration to use <release> instead of <source> and <target>#1205

Merged
egonw merged 1 commit intocdk:mainfrom
uli-f:maven-compiler-plugin-release-configuration
Jul 21, 2025
Merged

update maven-compiler-plugin configuration to use <release> instead of <source> and <target>#1205
egonw merged 1 commit intocdk:mainfrom
uli-f:maven-compiler-plugin-release-configuration

Conversation

@uli-f
Copy link
Copy Markdown
Member

@uli-f uli-f commented Jul 21, 2025

I noticed a bootstrap warning when compiling cdk-base;
bootstrap class path not set in conjunction with -source 8

ttbomk using release instead of source / target is best practice.

Setting <release>8</release> is essentially equivalent to:

  1. Setting <source>1.8</source>.
  2. Setting <target>1.8</target>.
  3. Additionally, it also configures the compiler to use the platform APIs of the specified Java version (Java 8 in this case), preventing accidental use of APIs from a newer JDK. This is accomplished by setting the --release flag of the compiler, which correctly configures the bootstrap classpath. javac

@egonw
Copy link
Copy Markdown
Member

egonw commented Jul 21, 2025

Sounds good to me.

@egonw egonw merged commit 2a17de1 into cdk:main Jul 21, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants