Skip to content

Releases: salesforce/rules_spring

2.6.1 Dec 2024 Bug Fixes for Multiarch, JAVABIN, debug

23 Dec 06:31
9342782
Compare
Choose a tag to compare

This release fixes a few issues:

  • springboot rule is now preconfigured for multi-arch oci use cases #250 (thanks for report @code-weirdo)
  • the JAVABIN environment variable is now a step in the precedence order for finding the JVM for bazel run commands #245
  • fixed the springboot rule environment variable name for debug logging (is it now properly upper cased) #148

Bzlmod:

# rules_spring is not in Bazel Central Registry yet, so use the specific commit
bazel_dep(name = "rules_spring", version = "2.6.1")
git_override(
    module_name = "rules_spring",
    remote = "https://github.com/salesforce/rules_spring",
    commit="9342782519d69a12aa92c47e06214802ed3ab265",
)

WORKSPACE:

http_archive(
    name = "rules_spring",
    sha256 = "98143672b2edd2eb84762a6ebe6afc3a194d1ec06bdfaaf0cc87d4d750476db0",
    urls = [
        "https://github.com/salesforce/rules_spring/releases/download/2.6.1/rules-spring-2.6.1.zip",
    ],
)

2.6.0 Dec 2024 Bazel Run Configuration Enhancements

22 Dec 03:10
5315945
Compare
Choose a tag to compare

This release improves configuration options for services launched via bazel run.

  • Added support for externalized configuration by loading application.properties files passed in the bazelrun_data attribute. See docs for details. #135
  • Added support for passing environment variables into the bazel run launcher script, which can be used to set Spring properties. See docs for details. #166
  • Fixes a bug whereby only the first datafile passed in the bazelrun_data array attribute was processed #238

Bzlmod:

# rules_spring is not in Bazel Central Registry yet, so use the specific commit
bazel_dep(name = "rules_spring", version = "2.6.0")
git_override(
    module_name = "rules_spring",
    remote = "https://github.com/salesforce/rules_spring",
    commit="531594577e815ca790ef4c10b1d84c7eb5281e24",
)

WORKSPACE:

http_archive(
    name = "rules_spring",
    sha256 = "b8c2de8a8123906c9d0fc5afd35dfde5f55d6030c4d72266e4dfd0543f621d89",
    urls = [
        "https://github.com/salesforce/rules_spring/releases/download/2.6.0/rules-spring-2.6.0.zip",
    ],
)

2.5.2 Dec 2024 Multi-target support, Bazel Run JVM Flag Improvements

21 Dec 07:50
9458a30
Compare
Choose a tag to compare

This release eliminates a couple of limitations in the springboot() macro. The first is the most notable:

  • Support multiple springboot targets in a single BUILD file; eliminates the limitation of having at most one #139

And an enhancement, and a bug fix, related to JVM flags used during Bazel run executions of springboot() targets:

  • Added new attribute bazelrun_jvm_flag_list as the new preferred form of bazelrun_jvm_flags. It has the same purpose but is more bazel-like: it is an array of JVM args, instead of a space separated string. bazelrun_jvm_flags is now deprecated. #234
  • Discovered that ADD_OPENS and ADD_EXPORTS Bazel run script variables were not working correctly in some cases. There was no delineation between them and JVM_FLAGS and so in some cases jvm flags were being mistaken for ADDs. This didn't cause any actual problems, but was messy. Removed those two variables since ADDs can just be lumped together as additional JVM_FLAGS in a single list. #234

Bzlmod:

# rules_spring is not in Bazel Central Registry yet, so use the specific commit
bazel_dep(name = "rules_spring", version = "2.5.2")
git_override(
    module_name = "rules_spring",
    remote = "https://github.com/salesforce/rules_spring",
    commit="9458a305f2978673cdeb26962d38fd0d4f7b7ad7",
)

WORKSPACE:

http_archive(
    name = "rules_spring",
    sha256 = "e08254a8dac77b1d3f85ada556038605c4106dbf09f92f26a06df511d16e6471",
    urls = [
        "https://github.com/salesforce/rules_spring/releases/download/2.5.2/rules-spring-2.5.2.zip",
    ],
)

2.5.1 Dec 2024 Bzlmod fix, bazelrun script fixes

10 Dec 05:12
c262ed5
Compare
Choose a tag to compare

This is a bug fix release:

  • Fixes an error in the Bzlmod MODULE.bazel of 2.5.0 related to the dev dependency rules_jvm_external #229
  • Fixes an issue with the bazelrun script, due to the first line being a blank line #143 (@drmercer-lucid)
  • Fixes a packaging problem with the bazelrun script when --nolegacy_external_runfiles is used #227 (@drmercer-lucid)
  • Stood up a public test repo for testing rules_spring releases; previously we relied on an internal monorepo for all testing. This will allow us to innovate with rules_spring faster.

Bzlmod:

# rules_spring is not in Bazel Central Registry yet, so use the specific commit
bazel_dep(name = "rules_spring", version = "2.5.1")
git_override(
    module_name = "rules_spring",
    remote = "https://github.com/salesforce/rules_spring",
    commit="29e7be015415b1a80e706cf40e333b1a6251961b",
)

WORKSPACE:

http_archive(
    name = "rules_spring",
    sha256 = "fe247b8b8bd58c82023e0b4212484724bf17f81394f97e913c522cea68b125e8",
    urls = [
        "https://github.com/salesforce/rules_spring/releases/download/2.5.1/rules-spring-2.5.1.zip",
    ],
)

2.5.0 Dec 2024 Transition to Bzlmod

09 Dec 00:33
168362d
Compare
Choose a tag to compare

Fully transitioned to Bzlmod for workspace dependency management. MODULE.bazel now fully describes the workspace dependencies, and WORKSPACE has been deleted.

NOTE: this release has a bug in the MODULE.bazel file, and is not recommended for use. Use 2.5.1 instead.

If you are just starting your Bzlmod journey, here are some good starting points:

Bzlmod:

# rules_spring is not in Bazel Central Registry yet, so specify the 2.5.0 commit
bazel_dep(name = "rules_spring", version = "2.5.0")
git_override(
    module_name = "rules_spring",
    remote = "https://github.com/salesforce/rules_spring",
    commit="168362d1a70a2f032700f77498aa4d3d863ff144",
)

WORKSPACE:

http_archive(
    name = "rules_spring",
    sha256 = "5a4f83c892ac072088e4a03d3647c8282f782b097a33bdb01723c63ae930311d",
    urls = [
        "https://github.com/salesforce/rules_spring/releases/download/2.5.0/rules-spring-2.5.0.zip",
    ],
)

2.4.2 Dec 2024 rules_license and Bazel Constraint Attributes

08 Dec 01:44
aceae5b
Compare
Choose a tag to compare

This release adds a few minor features:

  • Adds support for restricted_to and target_compatible_with attributes (Bazel standard attributes) #219 (@bhnord)
  • Adds official license targets using rules_license #222 and #223

To use this release:

Bzlmod:

  bazel_dep(name = "rules_spring", version = "2.4.2")
  git_override(
      module_name = "rules_spring",
      remote = "https://github.com/salesforce/rules_spring",
      commit="23b0fb07c56820f0d576b24a8879841f4165b568",
  )

WORKSPACE:

http_archive(
    name = "rules_spring",
    sha256 = "95e0bc66b8d3424cddbe37ca75babff372a8f80c833d5dce6e87277476a9b97c",
    urls = [
        "https://github.com/salesforce/rules_spring/releases/download/2.4.2/rules-spring-2.4.2.zip",
    ],
)

2.4.1 Dec 2024 Better Deps Filter

03 Dec 05:27
d7f34c1
Compare
Choose a tag to compare

This release does not change the rule implementation, but contains two good enhancements:

  • We have overhauled how to eliminate unwanted dependencies. The new deps_filter_transitive filter has the same behavior as the deps_exclude attribute, but also applies to the classpath used in tests so is more accurate. #171
  • Fixed an issue with extraneous files in the release zip file. #212

To use this release:

http_archive(
    name = "rules_spring",
    sha256 = "939dd1399ff75a067a20aeeef2000c3a37791e54c8c5a899e78bd8175341263a",
    urls = [
        "https://github.com/salesforce/rules_spring/releases/download/2.4.1/rules-spring-2.4.1.zip",
    ],
)

2.4.0 Oct 2024 Minor Enhancements

31 Oct 04:00
23c614b
Compare
Choose a tag to compare

This is a minor release.

  • Feature: fail build by default if junit/mockito in deps #207
  • Bug: Fix non-determinism in build-data.properties file #205 (thanks @jpgxs)
  • Feature: add jartools_toolchains attribute for an obscure use case #209

To use this release:

http_archive(
    name = "rules_spring",
    sha256 = "c99a54db3e86ee3a5ff2cdd545824ec1d3d41f72644ca48283218ce56190b3b1",
    urls = [
        "https://github.com/salesforce/rules_spring/releases/download/2.4.0/rules-spring-2.4.0.zip",
    ],
)

2.3.2 Mar 2024 Support for add-opens and add-exports

19 Mar 14:30
55bdaae
Compare
Choose a tag to compare

This will assist users migrating to JDK17 and beyond, as they will sometimes be impacted by stricter Java modularization enforcement.

The JDK has two mechanisms for loosening those restrictions described here:

  1. add-exports
  2. add-opens

For example: To add add-opens and add-exports for a springboot target.

springboot(
  name = "ordering-service",
  boot_app_class = "com.salesforce.services.ordering.OrderingService",
  java_library = ":base_lib",
  bazelrun_addopens = ["java.management/sun.management=ALL-UNNAMED"],
  bazelrun_addexports = ["java.base/java.base=ALL-UNNAMED"],
)

To use this new release, add this section to your WORKSPACE file:

http_archive(
    name = "rules_spring",
    sha256 = "87b337f95f9c09a2e5875f0bca533b050c9ccb8b0d2c92915e290520b79d0912",
    urls = [
        "https://github.com/salesforce/rules_spring/releases/download/2.3.2/rules-spring-2.3.2.zip",
    ],
)

2.3.1 Jan 2024 Support for Spring Boot 3.2.0

15 Jan 07:49
1854fbc
Compare
Choose a tag to compare

The features for this release come from Knut Eirik Leira Hjelle @hjellek (Takk skal du ha!).

These features target support for Spring Boot 3.2.0. Both relate to the new nested jar support.

  • Support for configuring the Boot Loader with the new boot_launcher_class rule attribute. This was a missing feature in general, and specifically is important for Boot 3.2.0 to use the new org.springframework.boot.loader.launch.JarLauncher #177
  • Support the NestedFileSystemProvider (internal packaging change, not user visible) #176