kriscfoster / rules_spring

Bazel rule for building Spring Boot apps as a deployable jar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 directory:

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

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. Note that we do not yet support running these rules on Windows.

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 = "7495e33261e4e69777a611e42c2e7a4f45021f6a8bb1eae1b064ca5653a61835",
    urls = [
        "https://github.com/salesforce/rules_spring/releases/download/2.2.2/rules-spring-2.2.2.zip",
    ],
)

Do not use a git_repository rule with our main 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 main branch, Please do not do this, as we use main for ongoing work. We may check breaking changes into main 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. 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.

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.

About

Bazel rule for building Spring Boot apps as a deployable jar

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Starlark 36.8%Language:Shell 29.1%Language:Java 18.0%Language:Python 16.1%