fix: make rules_java available in rules_spring for Bazel 9.0 #282
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR updates
rules_springto be compatible with Bazel 9 / Bzlmod by makingrules_javaproperly available across the project. Previously, many.bzlfiles (includingspringboot.bzl) failed to build due to missing Java symbols likeJavaInfoandjava_binary.With Bazel 9, Bzlmod changes the way dependencies are loaded at runtime: library-specific Starlark symbols are no longer implicitly available. Downstream users would encounter errors unless
rules_javawas manually included. This PR resolves that by declaringrules_javaas a dependency inMODULE.bazeland updating the relevant.bzlfiles to explicitly load the required symbols.Changes
rules_javatoMODULE.bazelso that Java toolchains and symbols are available project-wide..bzlfiles to load the necessary Java symbols (JavaInfo,java_binary) where they are used.Motivation / Problem
Without this change:
Notes
This PR will need some work from project maintainers to be ready to merge.