tree: 5e443becafcf6c737322f6f1042a600f032d679c [path history] [tgz]
  1. src/
  2. .bazelversion
  3. BUILD
  4. LICENSE.code.txt
  5. maven_install.json
  6. README.md
  7. WORKSPACE
examples/spring_boot/README.md

Spring Boot Example

This is an example of the tutorial app from Spring's website.

To build the Spring Boot application:

$ bazel build //src/main/java/hello:app

To run the Spring Boot application from Bazel:

$ bazel run //src/main/java/hello:app

To run the tests from Bazel:

$ bazel test //src/test/...

This tutorial code is licensed under Apache 2.0, copyright GoPivotal Inc.

Building a Deployable Jar

The example above shows how to launch a Spring Boot application from Bazel. Bazel builds a classpath using all of the dependency jars and launches the application.

Spring Boot also supports a deployable jar format in which the Spring Boot application is packaged as a single Java .jar file. This use case is typical in production, where the Bazel executable and Bazel workspace are not available.

Use this external Spring Boot rule implementation if a deployable jar is needed: