Skip to content

Bazel rule for building Spring Boot apps as a deployable jar

License

Notifications You must be signed in to change notification settings

mcamenzind/rules_spring

 
 

Salesforce Spring Rules for Bazel

This repository contains the Spring Boot rule for the Bazel build system. It enables Bazel to build Spring Boot applications and package them as an executable jar file. The executable jar is the best way to deploy your Spring Boot application in production environments.

The Salesforce springboot rule can be found, along with documentation, in this location:

  • springboot: a Bazel extension to build and package Spring Boot applications

🔥 this Git repository was renamed from bazel-springboot-rule to rules_spring on March 17, 2021. This was done to comply with required Bazel naming conventions for external rules.

Support and Ongoing Development

This rule was developed and is supported by Salesforce. If you have any issues with this repository, please create a GitHub Issue. We will try to quickly address problems and answer questions.

Ongoing development is planned and tracked using this GitHub repository's Project Manager. To see what bug fixes and new features are planned, consult the roadmaps located there.

:octocat: Please do us a huge favor. If you think this project could be useful for you, now or in the future, please hit the Star button at the top. That helps us advocate for more time and resources on this project. Thanks!

Loading the Spring Rules in your WORKSPACE

Before you can use the rule in your BUILD files, you need to add it to your workspace.

Reference an official release This loads a pre-built version of this rule into your workspace during the build. This is the recommended approach for most users.

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

Do not use a git_repository rule with our master branch If you choose not to use an official release, you may be tempted to use a git_repository workspace rule to point to our master branch, Please do not do this, as we use master for ongoing work. We may check breaking changes into master at any time.

Alternate Approach for Building and Running Spring Boot Applications

If you don't need to create a runnable executable jar file, there is an alternate approach to Spring Boot in the rules_jvm_external repository. That approach is sufficient if Bazel and your Bazel workspace (i.e. source code) are available in all environments that launch the application.

At Salesforce, Bazel is not available in production environments, and so this alternate approach is not viable.

Upgrades

This section contains notes for specific upgrade steps needed to adopt newer versions of rules-spring. Starting with the 1.1.x line, we strive to adhere to SemVer.

2.0.0: March 13, 2021

This release refactored the rule with the standardized Bazel rule layout conventions. When the Spring Boot rule was originally written, the conventions did not exist. This repackaging makes the rule more modern.

For rule 1.x users upgrading to 2.0.0, you will need to do the following:

  • All WORKSPACE and BUILD file references to bazel_springboot_rule must be changed to rules_spring
  • All BUILD and .bzl file references to //tools/springboot must be changed to //springboot

See Repackaging work item for more details.

1.0.0 September 21, 2020

With this release we switched the repo to use maven_install style dependencies, instead of the obsolete maven_jar. The maven_jar rule was removed from Bazel in 2.x.

About

Bazel rule for building Spring Boot apps as a deployable jar

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Starlark 44.0%
  • Shell 35.3%
  • Python 20.7%