Skip to content

Conversation

@yakovliam
Copy link

Summary

This PR updates rules_spring to be compatible with Bazel 9 / Bzlmod by making rules_java properly available across the project. Previously, many .bzl files (including springboot.bzl) failed to build due to missing Java symbols like JavaInfo and java_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_java was manually included. This PR resolves that by declaring rules_java as a dependency in MODULE.bazel and updating the relevant .bzl files to explicitly load the required symbols.


Changes

  • Added rules_java to MODULE.bazel so that Java toolchains and symbols are available project-wide.
  • Updated .bzl files to load the necessary Java symbols (JavaInfo, java_binary) where they are used.
  • Ensured compatibility with Bazel 9 and Bzlmod runtime dependency resolution.
  • Updated dependency versions

Motivation / Problem

Without this change:

springboot.bzl:41:43: name 'JavaInfo' is not defined

Notes

This PR will need some work from project maintainers to be ready to merge.

@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @yakovliam to sign the Salesforce Inc. Contributor License Agreement.

@yakovliam
Copy link
Author

yakovliam commented Jan 21, 2026

Just a note: I didn’t focus much on project conventions or code style in this PR – the main goal was to get rules_java properly available and ensure everything builds under Bazel 9. The changes are functional and the project builds successfully.

@plaird
Copy link
Contributor

plaird commented Jan 21, 2026

Thanks. This is making my release decisions easier. There were backwards incompat changes made to our deps_filter utility (not really the main feature of rules_spring, but reachable in Starlark) so I was debating what to do. Having this included makes me want to just jump to 3.0.0 and be honest about back compat. This is a big enough feature (Bazel 9) to warrant a major.

@yakovliam
Copy link
Author

Thanks. This is making my release decisions easier. There were backwards incompat changes made to our deps_filter utility (not really the main feature of rules_spring, but reachable in Starlark) so I was debating what to do. Having this included makes me want to just jump to 3.0.0 and be honest about back compat. This is a big enough feature (Bazel 9) to warrant a major.

Let me know if there's more I can do to help this along. Additionally, I'm not sure why the CLA is failing; I did sign it.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants