3.3
Project update: we have @shs96c joining the project as a co-maintainer. Welcome, Simon!
If you are interested in helping us maintain this project, please contact us on the #maven channel on https://slack.bazel.build.
Changelog
- @justhecuke fixed an issue where a jetified Maven artifact did not also jetify the artifact's dependencies #386
- @kevingessner added support for additional netrc lines for downloading pinned artifacts #394
- @kevingessner added support for using
jq
instead of Python to format the pinned maven_install.json, thus removing another system dependency on Python #396 - @wisechengyi added support for a custom Coursier download url via COURSIER_URL env var #402
- @cheister improved artifact pinning's update performance by reusing Coursier's cache #407
- @jin added a verbose mode to debug and surface Coursier's stdout with RJE_VERBOSE #408
- @cheister fixed an issue with the coursier cache path logic for #417 #419
- @shs96c created a suite of rules to upload artifacts to maven repositories. #413
- @shs96c fixed an issue with
jq
breaking artifact pinning #426 - @shs96c extended the MergeJar tool to support configurable duplicate merging algorithms #424
Usage
In your WORKSPACE file, add:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_JVM_EXTERNAL_TAG = "3.3"
RULES_JVM_EXTERNAL_SHA = "d85951a92c0908c80bd8551002d66cb23c3434409c814179c0ff026b53544dab"
http_archive(
name = "rules_jvm_external",
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
sha256 = RULES_JVM_EXTERNAL_SHA,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)
load("@rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
artifacts = [
"junit:junit:4.12",
"androidx.test.espresso:espresso-core:3.1.1",
"org.hamcrest:hamcrest-library:1.3",
],
repositories = [
"https://jcenter.bintray.com/",
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
)
In your BUILD file, reference the targets directly:
java_library(
name = "java_test_deps",
exports = [
"@maven//:junit_junit"
"@maven//:org_hamcrest_hamcrest_library",
],
)
android_library(
name = "android_test_deps",
exports = [
"@maven//:junit_junit"
"@maven//:androidx_test_espresso_espresso_core",
],
)