Bazel Java Builder Template
A template for wrapping any Java builder (eg., Maven Takari builder) and bring it into Bazel.
How it works
This template was heavily inspired by rules_scala and rules_avro. It follows the recommendation given by Deploying Rules. It's designed to allow wrapping existing Java builders (eg., like Maven Takari builders) for Bazel. These builders don't need to be pre-built. Instead they will be compiled as part of the Bazel build using those.
Support for persistent workers is included.
- Clone this Git repo
- Copy your builder source code into
- Add the builder dependencies to
builder_rulesfunction (see mybuilder.bzl).
- Use the
rename.shscript to rename the rules.
This project uses both: Maven and Bazel. Maven is used for best IDE experience. Bazel is used for command line build and delivery.
Few things to keep in mind:
- The Bazel build files are source of truth for producing deliverables, i.e. don't bother adding Maven plug-ins to
- Maven drives Eclipse M2E for development of this tool. Nothing more.
- Don't get too fancy with Bazel, though. It has to map to Maven for IDE classpath computation.
- We'll eventually switch from M2E to the Bazel plug-in once it's more usable.