This is a simple java example project that tries to follow best practices.
- Clone the repo k
- Install bazelisk
- Build the repo:
./bazel build //... ./bazel test //...
- Add/remove dependencies in MODULE.bazel
- See instructions in this file for re-generating the pinned dependency file.
- Flat project layout, one BUILD file per directory.
- Works with IntelliJ plugin
- Uses bazelisk to pin the version of bazel
- See .bazelversion
- Uses
rules_jvm_external
for external maven dependencies (guava, junit, dagger)- This supports transitive deps
- Downloads 3rd party source code (e.g. for IntelliJ)
- BUILD/Java formatter
- Logging via log4j2
- REST
- JUnit4 + AssertJ tests
- Run junit tests with a simple glob (technically not a best practice, but more ergonomic)
- JMH microbenchmarks
TODO (WIP):
- Protobuf / gRPC examples
- Metrics / Tracing
- Java 20 / Loom preview