6.1
Please note The lock file format was changed in rules_jvm_external
5.1. If you update and repin your dependencies, your lock file will use the new format.
Usage
This version of rules_jvm_external
requires Bazel 5.4.1, Bazel 6.5.0, or Bazel 7 or above.
This release requires Java 11 or above to run, both as the host JDK and the build and tool JDK.
Bzlmod
If you are using Bazel 7 or above, in your MODULE.bazel
file:
bazel_dep(name = "rules_jvm_external", version = "6.1")
To add dependencies, later in your MODULE.bazel
file:
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
artifacts = [
"org.seleniumhq.selenium:selenium-java:4.16.1",
],
repositories = [
"https://repo1.maven.org/maven2",
],
lock_file = "//:maven_install.json",
)
use_repo(
maven,
"maven",
)
Workspace-based builds
In your WORKSPACE
file, add:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_JVM_EXTERNAL_TAG = "6.1"
RULES_JVM_EXTERNAL_SHA = "08ea921df02ffe9924123b0686dc04fd0ff875710bfadb7ad42badb931b0fd50"
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/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG)
)
load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
rules_jvm_external_deps()
load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")
rules_jvm_external_setup()
Then, later in your WORKSPACE
file, you can pull in dependencies from a maven repository:
load("@rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
artifacts = [
"org.seleniumhq.selenium:selenium-java:4.16.1",
],
repositories = [
"https://repo1.maven.org/maven2",
],
maven_install_json = "//:maven_install.json",
)
Using dependencies
In your BUILD.bazel
file, reference the targets directly:
java_library(
name = "example",
exports = [
"@maven//:org_seleniumhq_selenium_selenium_java",
],
)
What's Changed
- Add
manifest_entries
tojava_export
by @shs96c in #1050 - Add the ability to pass args to MavenPublisher by @loganasherjones in #937
- Do not remove LICENSE files when combining jars by @gkdn in #1054
- Support so/dylib/dll packaging types by @dzbarsky in #959
- tests for artifact with plus by @gergelyfabian in #1053
- Make jvm_import use
java
from resolved toolchain instead of host machine. by @jin in #1058 - Use tool instead of compilation runtime in
jvm_import
actions by @fmeum in #1059 - Fix timout->timeout typo by @brianduff in #1062
- fix: determine the version of java correctly by @yesudeep in #1069
- Introduce a maven resolver by @shs96c in #989
- Remove dev_dependency from rules_android in bzlmod by @erikkerber in #1085
- Fixes problem with bom file generation with Bazel 7 by @shs96c in #1079
- Remove maven_jar_migrator from MODULE.bazel by @scaiper in #1071
- Support use_credentials_from_home_netrc_file via bzlmod extension by @erikkerber in #1089
- Index service implementations as well as packages by @illicitonion in #1063
- Generate java_plugin targets for annotation processors by @illicitonion in #1102
- Remove outdated info from README by @daivinhtran in #1105
- Improve repinning performance by not recomputing cache path for every artifact by @BalestraPatrick in #1108
- Add an exception for COPYRIGHT and NOTICE files in the same way as LICENSE by @vinnybod in #1107
New Contributors
- @loganasherjones made their first contribution in #937
- @gkdn made their first contribution in #1054
- @dzbarsky made their first contribution in #959
- @brianduff made their first contribution in #1062
- @yesudeep made their first contribution in #1069
- @erikkerber made their first contribution in #1085
- @scaiper made their first contribution in #1071
- @daivinhtran made their first contribution in #1105
- @BalestraPatrick made their first contribution in #1108
- @vinnybod made their first contribution in #1107
Full Changelog: 6.0...6.1