Help with Java and Maven dependency management using the rules_jvm_external
Pin the maven dependencies
bazel run @maven//:pin
Whenever you make a change to the list of artifacts
or repositories
and want to update
maven_install.json
, run the following command to re-pin the unpinned @maven repository:
bazel run @unpinned_maven//:pin
yarn install
bazel run @nodejs//:yarn_node_repositories
add npm dev dependency
bazel run @nodejs//:yarn -- add -D @bazel/ibazel
to build a fat jar with bazel, you need to add _deploy.jar
suffix to the
java_binary
target name. The final jar will be named target_name_deploy.jar
.
bazel run //bookmarker/server/src/main/java/me/a6n/bookmarker:micronaut_deploy.jar
Load a container_image
into docker
bazel run //bookmarker:server_image
brew tap bazelbuild/tap
brew install bazelbuild/tap/ibazel
Run bazel shutdown
A workaround for this is to edit the file and set the full path of jq
, delete the empty
maven_install.json
file and run it again...EVERY TIME I add a new dependency