Releases: bazelbuild/rules_jvm_external
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
6.0
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.4.0, or Bazel 7 or above.
Bzlmod
If you are using Bazel 7 or above, in your MODULE.bazel
file:
bazel_dep(name = "rules_jvm_external", version = "6.0")
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.0"
RULES_JVM_EXTERNAL_SHA = "85fd6bad58ac76cc3a27c8e051e4255ff9ccd8c92ba879670d195622e7c0a9b7"
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",
],
)
New Contributors
- @kotlaja made their first contribution in #933
- @daewoongoh made their first contribution in #921
- @tirsen made their first contribution in #948
- @agluszak made their first contribution in #984
- @bertschneider made their first contribution in #1002
- @blorente made their first contribution in #996
What's Changed
- Requires Java 11 or above
- Removed support for
jetify
- Improved Bazel 7 and
bzlmod
support - Fix pinning error with Bzlmod by @fmeum in #939
- Allow passing sensitive credentials for java_export with environment variables by @thirtyseven in #927
- Add classifier_artifacts parameter to java_export to allow users to publish extra artifacts by @thirtyseven in #926
- Fix excluded_artifacts for bzlmod by @tirsen in #948
- Fix
testonly
attribute handling by @meteorcloudy in #955 - Add compile-only deps to javadocs classpath by @fmeum in #952
- javadoc: Allow
javadoc
targets to reference otherjavadoc
targets by @fmeum in #958 - java_export: Fix Make variable substitution by @fmeum in #960
- Only print repin warnings if the repin env vars are missing by @shs96c in #975
- Normalise timestamps from maven_project_jar with those from java_library by @shs96c in #982
- Disable JVM perfdata when stamping jars by @cheister in #988
- Handle conflict markers and empty files for the maven_install lock_file parameter by @shs96c in #991
- Publish java_export target without sources jar by @bertschneider in #1002
- feat(maven_install): Customizable repin instructions by @blorente in #1000
- Allow the "raw" version of overridden targets to be used by @shs96c in #994
- m2local: solve files not getting resolved by @gergelyfabian in #961
- Treat empty files in pinning as if they weren't available by @gergelyfabian in #969
- fix: Publish artifacts without additional classifiers by @bertschneider in #1011
- Allow the root module to always set the lock file by @shs96c in #1040
- Update coursier to v2.1.8 by @cheister in #1042
Full Changelog: 5.3...6.0
5.3
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 4 or above.
In your WORKSPACE file, add:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_JVM_EXTERNAL_TAG = "5.3"
RULES_JVM_EXTERNAL_SHA ="d31e369b854322ca5098ea12c69d7175ded971435e55c18dd9dd5f29cc5249ac"
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 = [
"junit:junit:4.13.2",
"androidx.test.espresso:espresso-core:3.1.1",
"org.hamcrest:hamcrest-library:2.2",
],
repositories = [
"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",
],
)
New Contributors
- @thirtyseven made their first contribution in #904
- @rdesgroppes made their first contribution in #908
What's Changed
- Bump to Coursier v2.1.2. by @jin in #889
- Bump Robolectric to 4.10 by @utzcoz #891
- Allow semicolons in maven_repo by @thirtyseven in #904
- Allow artifacts from aspects to be excluded by @shs96c in #898
- Use runfiles lookup by @alexeagle in #900
- Add preliminary support for
exe
packaging type by @rdesgroppes in #908 - Fix transitive dep resolution when exclusion is present in other POM by @artem-zinnatullin in #919
New Contributors
Full Changelog: 5.2...5.3
5.2
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 4 or above.
In your WORKSPACE file, add:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_JVM_EXTERNAL_TAG = "5.2"
RULES_JVM_EXTERNAL_SHA ="f86fd42a809e1871ca0aabe89db0d440451219c3ce46c58da240c7dcdc00125f"
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 = [
"junit:junit:4.13.2",
"androidx.test.espresso:espresso-core:3.1.1",
"org.hamcrest:hamcrest-library:2.2",
],
repositories = [
"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",
],
)
New features
bzlmod
users can now use the compat repos should they need to.
New Contributors
- @vorburger made their first contribution in #873
- @sacsar made their first contribution in #858
- @davidkurkov made their first contribution in #883
What's Changed
- Remove hard-coded version in bazel_dep example by @vorburger in #873
- Handle the case where dependencies are empty by @sitaktif in #874
- Expose maven_export by @sacsar in #858
- 'excluded_artifacts' should be formatted in json spec by @yrom in #879
- Allow compat repos to be generated when using
bzlmod
by @shs96c in #880 - Strip auth from url-with-basic-auth when mapping coords by @davidkurkov in #883
- Add kotlin_stdlib to kt_jvm_export deploy_env. by @sacsar in #884
- Skip non-source maven local dependencies in
generate_imports
by @lukaciko in #886
Full Changelog: 5.1...5.2
5.1
Please note The lock file format has changed with this release. If you update and repin your dependencies, your lock file will use the new format.
Usage
This version of rules_jvm_external
requires Bazel 4 or above.
In your WORKSPACE file, add:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_JVM_EXTERNAL_TAG = "5.1"
RULES_JVM_EXTERNAL_SHA ="8c3b207722e5f97f1c83311582a6c11df99226e65e2471086e296561e57cc954"
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 = [
"junit:junit:4.13.2",
"androidx.test.espresso:espresso-core:3.1.1",
"org.hamcrest:hamcrest-library:2.2",
],
repositories = [
"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",
],
)
New features
- Introduce a new lock file format. This is designed to be more stable as dependencies are updated. Your lock file will be updated when you repin your maven dependencies. For the default dependency, you can do this using
REPIN=1 bazel run @unpinned_maven//:pin
- The outdated command now shows pre-release and regular release information
- Updated
coursier
to v2.1.0-RC6 - The
use_unsafe_shared_cache
option has been removed frommaven_install
New Contributors
- @richardstephens made their first contribution in #790
- @jasonwyatt made their first contribution in #798
- @jonshea made their first contribution in #797
- @knarukulla made their first contribution in #794
- @anthonyjpratti made their first contribution in #825
- @rickeylev made their first contribution in #847
- @z8v made their first contribution in #848
- @caseyduquettesc made their first contribution in #859
What's Changed
- fix: provide our own remove_prefix implementation by @richardstephens in #790
- Ensure missing directories are added to zips by @shs96c in #785
- Add instructions for IPv6 support in rules_jvm_external. by @jin in #791
- Bump coursier to v2.1.0-RC2 by @jin in #792
- Add section re: issues with nonstandard JDKs. by @jasonwyatt in #798
- Document Android SDK dependency for tests by @jonshea in #797
- Prefer artifacts with dependencies when de-duplicating coursier dependencies by @cheister in #801
- maven version expanded by @knarukulla in #794
- fix NO_PROXY handling under Java 9+ by @beasleyr-vmw in #784
- Avoid failing the build if
deploy_env
isNone
by @shs96c in #823 - Normalize path returned by get_coursier_cache_or_default in _relativize_and_symlink_file_in_coursier_cache by @anthonyjpratti in #825
- Avoid duplicating items in the dependencies BOM by @shs96c in #832
- Remove the
unsafe_shared_cache
option by @shs96c in #834 - Remove 'sp' from MAVEN_PRE_RELEASE_QUALIFIERS for outdated by @cheister in #840
- V2 lock file format by @shs96c in #822
- docs: add documentation for starting with bzlmod by @alexeagle in #838
- Remove broken README link to Persistent Artifact Cache by @artem-zinnatullin in #845
- Remove --host_force_python from example bazelrc by @rickeylev in #847
- Add missing parenthesis on bzlmod docs by @z8v in #848
- Fix dependencies BOM so it does not include a circular dep by @shs96c in #856
- Set http.proxyProtocol and https.proxyProtocol for coursier by @cheister in #863
- transitive dependencies should be visible to their compat alias by @caseyduquettesc in #859
- list_packages should not fail when the jar is invalid by @cheister in #867
- Update coursier to v2.1.0-RC6 by @cheister in #868
- Updated the
MODULE.bazel
ready for release to the BCR.
Full Changelog: 4.5...5.1
5.0
Please note The lock file format has changed with this release. If you update and repin your dependencies, your lock file will use the new format.
Usage
This version of rules_jvm_external
requires Bazel 4 or above.
In your WORKSPACE file, add:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_JVM_EXTERNAL_TAG = "5.0"
RULES_JVM_EXTERNAL_SHA ="8c3cd0ce6aa3dd8c01a414385e0a3807c7a14c769ca0aa3c53fb135c91f9198c"
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/5.0/rules_jvm_external-%s.tar.gz" % 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 = [
"junit:junit:4.13.2",
"androidx.test.espresso:espresso-core:3.1.1",
"org.hamcrest:hamcrest-library:2.2",
],
repositories = [
"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",
],
)
New features
- Introduce a new lock file format. This is designed to be more stable as dependencies are updated. Your lock file will be updated when you repin your maven dependencies. For the default dependency, you can do this using
REPIN=1 bazel run @unpinned_maven//:pin
- The outdated command now shows pre-release and regular release information
- Updated
coursier
to v2.1.0-RC6 - The
use_unsafe_shared_cache
option has been removed frommaven_install
What's Changed
New Contributors
- @richardstephens made their first contribution in #790
- @jasonwyatt made their first contribution in #798
- @jonshea made their first contribution in #797
- @knarukulla made their first contribution in #794
- @anthonyjpratti made their first contribution in #825
- @rickeylev made their first contribution in #847
- @z8v made their first contribution in #848
- @caseyduquettesc made their first contribution in #859
What's Changed
- fix: provide our own remove_prefix implementation by @richardstephens in #790
- Ensure missing directories are added to zips by @shs96c in #785
- Add instructions for IPv6 support in rules_jvm_external. by @jin in #791
- Bump coursier to v2.1.0-RC2 by @jin in #792
- Add section re: issues with nonstandard JDKs. by @jasonwyatt in #798
- Document Android SDK dependency for tests by @jonshea in #797
- Prefer artifacts with dependencies when de-duplicating coursier dependencies by @cheister in #801
- maven version expanded by @knarukulla in #794
- fix NO_PROXY handling under Java 9+ by @beasleyr-vmw in #784
- Avoid failing the build if
deploy_env
isNone
by @shs96c in #823 - Normalize path returned by get_coursier_cache_or_default in _relativize_and_symlink_file_in_coursier_cache by @anthonyjpratti in #825
- Avoid duplicating items in the dependencies BOM by @shs96c in #832
- Remove the
unsafe_shared_cache
option by @shs96c in #834 - Remove 'sp' from MAVEN_PRE_RELEASE_QUALIFIERS for outdated by @cheister in #840
- V2 lock file format by @shs96c in #822
- docs: add documentation for starting with bzlmod by @alexeagle in #838
- Remove broken README link to Persistent Artifact Cache by @artem-zinnatullin in #845
- Remove --host_force_python from example bazelrc by @rickeylev in #847
- Add missing parenthesis on bzlmod docs by @z8v in #848
- Fix dependencies BOM so it does not include a circular dep by @shs96c in #856
- Set http.proxyProtocol and https.proxyProtocol for coursier by @cheister in #863
- transitive dependencies should be visible to their compat alias by @caseyduquettesc in #859
- list_packages should not fail when the jar is invalid by @cheister in #867
- Update coursier to v2.1.0-RC6 by @cheister in #868
Full Changelog: 4.5...5.0
4.5
Usage
This version of rules_jvm_external
requires Bazel 4 or above.
In your WORKSPACE file, add:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_JVM_EXTERNAL_TAG = "4.5"
RULES_JVM_EXTERNAL_SHA ="b17d7388feb9bfa7f2fa09031b32707df529f26c91ab9e5d909eb1676badd9a6"
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/refs/tags/%s.zip" % 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 = [
"junit:junit:4.13.2",
"androidx.test.espresso:espresso-core:3.1.1",
"org.hamcrest:hamcrest-library:2.2",
],
repositories = [
"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",
],
)
New features
What's Changed
- @pcj feature: add coursier --credentials from home netrc #778
- @brujoand Strip username from pinned urls #772
- @tsawada Add Google Artifact Registry support to java_export by #779
- @lukaciko Enable manifest stamping by default #771
- @utzcoz Bump Robolectric to 4.9 for *android_local_test #764
- @shs96c Bug fixes in
bzlmod
support #760 , #773 - @fmeum Performance improvements #765, #769
- @fmeum Add
deploy_env
tojava_exports
's javadoc class path #768 - @fmeum Filter
java_export
source jar based ondeploy_env
by #767 - @shs96c Generate a stub so
bzl_library
works as expected #761 - @fmeum Do not include Target-Label in
java_export
manifests #766 - @fmeum Ensure native rules find
maven_project_jar
in runfiles #775 - @fmeum Mention that
java_binary
isn't supported injava_export
deploy_env
#776
New Contributors
Full Changelog: 4.4.2...4.5
4.4.2
Usage
This version of rules_jvm_external
requires Bazel 4 or above.
In your WORKSPACE file, add:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_JVM_EXTERNAL_TAG = "4.4.2"
RULES_JVM_EXTERNAL_SHA = "735602f50813eb2ea93ca3f5e43b1959bd80b213b836a07a62a29d757670b77b"
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/refs/tags/%s.zip" % 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 = [
"junit:junit:4.13.2",
"androidx.test.espresso:espresso-core:3.1.1",
"org.hamcrest:hamcrest-library:2.2",
],
repositories = [
"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",
],
)
New features
These are the notable changes for 4.3. For the full list, see this page.
- @shs96c Bzlmod support in #654
- @mauriciogg Enable
pinned_coursier_fetch
to use the Starlark version ofaar_import
in #729 - @shs96c Generate both a BOM and a dependency BOM in #750
The only changes since 4.4 are to support rules_jvm_external
being exposed through the Bazel
Central Repository and accessible via bzlmod
Bug fixes
- @davidmandle Quote java arguments written to arguments file in #721
- @shs96c Use stable zip entries in
MergeJars
in #736 - @shs96c Create empty directories in merged zip files in #737
- @dhalperi
coursier
: prefer the primary_url over mirrors in #743 - @lukaciko Make DOS timestamp local time zone independent in #738
Project health
- @utzcoz Bump Robolectric to 4.8.2 in #733
- @aranguyen Use constraint values from @platforms and migrate to rbe_preconfig in #730
- @mai93 Update bazel_skylib to latest version (1.2.1) in #742
- @shs96c Make rules_jvm_external use strict deps for itself in #741
New Contributors
- @aranguyen made their first contribution in #730
- @davidmandle made their first contribution in #721
- @mai93 made their first contribution in #742
- @lukaciko made their first contribution in #738
4.4.1
Usage
This version of rules_jvm_external
requires Bazel 4 or above.
In your WORKSPACE file, add:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_JVM_EXTERNAL_TAG = "4.4.1"
RULES_JVM_EXTERNAL_SHA = "9781dafe99cf604e1ce43e14598a71fbd6435d995c8069ccda7a3dc094aea333"
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/refs/tags/%s.zip" % 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 = [
"junit:junit:4.13.2",
"androidx.test.espresso:espresso-core:3.1.1",
"org.hamcrest:hamcrest-library:2.2",
],
repositories = [
"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",
],
)
New features
These are the notable changes for 4.3. For the full list, see this page.
- @shs96c Bzlmod support in #654
- @mauriciogg Enable
pinned_coursier_fetch
to use the Starlark version ofaar_import
in #729 - @shs96c Generate both a BOM and a dependency BOM in #750
Bug fixes
- @davidmandle Quote java arguments written to arguments file in #721
- @shs96c Use stable zip entries in
MergeJars
in #736 - @shs96c Create empty directories in merged zip files in #737
- @dhalperi
coursier
: prefer the primary_url over mirrors in #743 - @lukaciko Make DOS timestamp local time zone independent in #738
Project health
- @utzcoz Bump Robolectric to 4.8.2 in #733
- @aranguyen Use constraint values from @platforms and migrate to rbe_preconfig in #730
- @mai93 Update bazel_skylib to latest version (1.2.1) in #742
- @shs96c Make rules_jvm_external use strict deps for itself in #741
New Contributors
- @aranguyen made their first contribution in #730
- @davidmandle made their first contribution in #721
- @mai93 made their first contribution in #742
- @lukaciko made their first contribution in #738
4.4
Usage
This version of rules_jvm_external
requires Bazel 4 or above.
In your WORKSPACE file, add:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_JVM_EXTERNAL_TAG = "4.4"
RULES_JVM_EXTERNAL_SHA = "0068b92a1527799d7268f6774654ed35024a660c6c68ac1f8011edade905929d"
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/refs/tags/%s.zip" % 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 = [
"junit:junit:4.13.2",
"androidx.test.espresso:espresso-core:3.1.1",
"org.hamcrest:hamcrest-library:2.2",
],
repositories = [
"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",
],
)
New features
These are the notable changes for 4.3. For the full list, see this page.
- @shs96c Bzlmod support in #654
- @mauriciogg Enable
pinned_coursier_fetch
to use the Starlark version ofaar_import
in #729 - @shs96c Generate both a BOM and a dependency BOM in #750
Bug fixes
- @davidmandle Quote java arguments written to arguments file in #721
- @shs96c Use stable zip entries in
MergeJars
in #736 - @shs96c Create empty directories in merged zip files in #737
- @dhalperi
coursier
: prefer the primary_url over mirrors in #743 - @lukaciko Make DOS timestamp local time zone independent in #738
Project health
- @utzcoz Bump Robolectric to 4.8.2 in #733
- @aranguyen Use constraint values from @platforms and migrate to rbe_preconfig in #730
- @mai93 Update bazel_skylib to latest version (1.2.1) in #742
- @shs96c Make rules_jvm_external use strict deps for itself in #741
New Contributors
- @aranguyen made their first contribution in #730
- @davidmandle made their first contribution in #721
- @mai93 made their first contribution in #742
- @lukaciko made their first contribution in #738