Skip to content

Add enforceBytecodeVersion rule to bundle-sdk#6770

Open
RanVaknin wants to merge 1 commit intomasterfrom
rvaknin/add-enforceBytecodeVersion-to-bundle-sdk
Open

Add enforceBytecodeVersion rule to bundle-sdk#6770
RanVaknin wants to merge 1 commit intomasterfrom
rvaknin/add-enforceBytecodeVersion-to-bundle-sdk

Conversation

@RanVaknin
Copy link
Contributor

@RanVaknin RanVaknin commented Mar 10, 2026

Our CI already has build validations to ensure all of our code is compiled for Java 8. However, this does not apply to third party dependencies that we consume. If a transitive dependency is compiled for a higher JDK version, it can silently end up in the shaded SDK bundle and break customers running on Java 8 at runtime.

Example of desired check:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  31:03 min (Wall Clock)
[INFO] Finished at: 2026-03-10T17:58:30Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce (enforce-bytecode-version) on project bundle-sdk: 
[ERROR] Rule 0: org.codehaus.mojo.extraenforcer.dependencies.EnforceBytecodeVersion failed with message:
[ERROR] Found Banned Dependency: com.github.ben-manes.caffeine:caffeine:jar:3.2.3
[ERROR] Use 'mvn dependency:tree' to locate the source of the banned dependencies.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :bundle-sdk

The build failed because the maven-enforcer-plugin flagged Caffeine 3.x as as being non compliant.

@RanVaknin RanVaknin requested a review from a team as a code owner March 10, 2026 17:20
@RanVaknin RanVaknin added changelog-not-required Indicate changelog entry is not required for a specific PR no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required labels Mar 10, 2026
@RanVaknin RanVaknin force-pushed the rvaknin/add-enforceBytecodeVersion-to-bundle-sdk branch from e94ba68 to 1508335 Compare March 11, 2026 21:01
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-not-required Indicate changelog entry is not required for a specific PR no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants