Skip to content

Releases: salesforce/rules_spring

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

2.3.0 Nov 2023 Bazel Run use Java Toolchain, and Javax->Jakarta Migration Support

05 Nov 01:13
77763b7
Compare
Choose a tag to compare

This release provides two enhancements.

What's Changed

Bazel Run Launch JVM

The springboot rule has been updated such that the JVM used to launch the service from bazel run will now use the JVM from the current java toolchain in the workspace, by default. This replaces the previous default behavior, which was to use JAVA_HOME.

In addition, there are two new options for overriding this behavior. See the launcher JVM docs for more details.

Javax => Jakarta Migration Support

This release includes a new javax detector that is not enabled by default. It detects any jar in the springboot dependency graph that contains a class from a javax package. It consults an ignorelist (that you provide) to determine if this is known jar. If not, it will fail the build.

If you haven't heard of the javax -> jakarta migration that is up-ending the Java community, this may seem like a strange feature. For more information, please see our new docs on this topic. The javax -> jakarta migration (which is required for Spring Boot 3), and the new detector feature, are explained there.

2.2.5-M2 October 2023 Bazel Run JVM

26 Oct 05:06
648b510
Compare
Choose a tag to compare
Pre-release

This release enhances the springboot rule such that the JVM used to launch the service from bazel run will now use the JVM from the current java toolchain in the workspace, by default. This replaces the previous default behavior, which was to use JAVA_HOME.

In addition, there are two new options for overriding this behavior. See the launcher JVM docs for more details.

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

2.2.5-M1 July 2023 Initial javax detector feature (jakarta migration support)

28 Jul 00:40
73fa087
Compare
Choose a tag to compare

This is an initial trial release of a new javax detector. It detects any jar in the springboot jar classpath that contains a class from a javax package. It consults an ignorelist (that you provide) to determine if this is known jar. If not, it will fail the build.

Context

If you haven't heard of the javax -> jakarta migration that is up-ending the Java community, this may seem like a strange feature. For more information, please see our new docs on this topic. The javax -> jakarta migration (which is required for Spring Boot 3), and the new detector feature, are explained there.

Because this is a trial release, the main docs do not reference it. To use it, please update your workspace file like so:

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

2.2.4 July 2023 Optionally omit git.properties in resulting jar

05 Jul 15:43
5e27859
Compare
Choose a tag to compare

What's Changed

  • provide mechanism to not include git.properties file in resulting jar by @kriscfoster in #168

Full Changelog: 2.2.3...2.2.4

2.2.3 June 2023 Support Propagating Visibility of Springboot Jar

21 Jun 08:06
d88c2a5
Compare
Choose a tag to compare

This release provides the ability for the springboot target to reside in a different package from another rule that uses it. This previously wasn't possible due to the visibility not being propagated.

What's Changed

New Contributors

Full Changelog: 2.2.2...2.2.3

2.2.2 January 2023 Support for Addins Feature

28 Jan 06:07
62f5f5e
Compare
Choose a tag to compare

This release provides a small feature to allow the developer to add arbitrary files to the root of the generated springboot jar. For example, this feature can be used to add a license file to the generated jar. This is accomplished by using the new addins attribute:

addins = [":info.txt", ":author.txt"],

The files are then added into the generated springboot jar:

jar -tvf bazel-bin/examples/demoapp/demoapp.jar | grep .txt
   132 Fri Jan 01 00:00:00 PST 2010 info.txt
    11 Fri Jan 01 00:00:00 PST 2010 author.txt

(Note: if you pulled the release on the first two days, you got a botched zip file that didn't actually include the new feature. I fixed the package on Jan 30. That changed the SHA. Apologies if that broke you)

2.2.1 April 2022 Support for Bazel's testonly attribute

23 Apr 05:51
39179b9
Compare
Choose a tag to compare

The Bazel standard testonly attribute is now accepted by the springboot macro, and applied to the generated subrules. This is to support the use case of a springboot application used for integration testing, which needs to depend on Java libraries that are marked testonly. #144

Also, the default branch of this repository is now main instead of master, to comply with modern Git standards. The master branch will be deleted sometime in the future. If you pull the this repository into your workspace using a git_repository rule with branch, make sure to switch to main.

2.2.0 Nov 2021 Support for bzlmod

19 Nov 01:32
9d09a46
Compare
Choose a tag to compare

This is not a feature bearing release. We added a MODULE.bazel file to support the new bzlmod packaging system for Bazel rules. This will allow us to apply to appear in the Bazel Central Registry.