Skip to content

Releases: bazel-contrib/rules_jvm_external

7.0

21 Apr 15:33
5482558

Choose a tag to compare

Please note The lock file format was changed in rules_jvm_external 5.1 and in 6.10. If you update and repin your dependencies, your lock file will use the new format.

Usage

This version of rules_jvm_external requires Bazel 7.7.1 or Bazel 8.6.0 or Bazel 9.

This release requires Java 11 or above to run, both as the host JDK and the build and tool JDK.

Bzlmod

In your MODULE.bazel file:

bazel_dep(name = "rules_jvm_external", version = "7.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.43.0",
    ],
    lock_file = "//:maven_install.json",
)

use_repo(maven, "maven")

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 support for classifier and exclusions fields in toml files by @staktrace in #1539
  • fix: Handle email-style usernames in Coursier cache path credentials by @vadikmironov in #1538
  • Remove workspace-based dependencies and ensure RJE works with Bazel 9 by @shs96c in #1536
  • Also handle the force_version field in the version catalog by @staktrace in #1542
  • Switch to toml.bzl for TOML parsing by @shs96c in #1540
  • Skip hash uploading for snapshots in MavenPublisher by @thirtyseven in #1544
  • fix: sort repositories in v3 lock file hash to match Java resolver order by @mfilippov in #1557
  • Upload primary artifact before uploading hashes in MavenPublisher by @thirtyseven in #1548

New Contributors

Full Changelog: 6.10...7.0

6.10

04 Feb 21:26
f23697e

Choose a tag to compare

Please note The lock file format was changed in rules_jvm_external 5.1 and again in 6.10. If you update and repin your dependencies, your lock file will use the new format.

Usage

This version of rules_jvm_external requires Bazel 6.5.0, Bazel 7.6.1 or Bazel 8.5.0 or Bazel 9.

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.10")

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.40.0",
    ],
    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.10"
RULES_JVM_EXTERNAL_SHA = "e5f83b8f2678d2b26441e5eafefb1b061826608417b8d24e5e8e15e585eab1ba"

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/bazel-contrib/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.38.0",
    ],
    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

  • Update to use Starlark rules_android. Reapply ba7310c by @ahumesky in #1297
  • coursier: ignore dependencies with classifier="sources" and no "file" by @mattnworb in #1479
  • Support stripping protobuf-java jars in java_export when using protoc via toolchain by @thirtyseven in #1481
  • Use persistent gradle home between invocations by @smocherla-brex in #1473
  • rules_java: add rules loads to fix autoload on Bazel 9 by @gergelyfabian in #1493
  • Fix issue with pom generation failing when checking exclusions by @vinnybod in #1500
  • Add finegrained control of the visibility of override targets by @JonathanPerry651 in #1488
  • fix(pom_file): exclusions referenced before assignment by @YavorPaunov in #1503
  • Provide a mechanism to list all resolved direct deps for a workspace by @shs96c in #1510
  • Allow an optional index of dep -> class to be created by @shs96c in #1492
  • Filter test_only artifacts out of artifacts merged into root repos and print a warning when a root artifact version is overridden by a non_root bazel_dep by @cheister in #1511
  • [gradle] Fix Gradle resolver to respect force_version and include runtime dependencies by @shs96c in #1516
  • Only allow modules specified in known_contributing_modules to contribute artifacts or boms to the root module by @cheister in #1523
  • Update the maven and coursier resolver tests to create a class index file. by @jeffmace in #1519
  • Added non-conflicting hash for install files by @MarconZet in #1454
  • fix: use forward slash separator in Maven purl format by @stevebarrau in #1530
  • fix: add string attributes to amend_artifact for explicit unset state by @JonathanPerry651 in #1499
  • fix: Do not add coursier opts when run other tools by @honnix in #1531
  • feat: Support COURSIER_SHA256 environment variable by @albertocavalcante in #1527
  • Upload artifacts in parallel (address artifactorys "Maven Snapshot Version Behaviour") by @IgorPerikov in #1524

New Contributors

Full Changelog: 6.9...6.10

6.9

04 Nov 16:25
425cdc8

Choose a tag to compare

6.9

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 6.5.0, Bazel 7.6.1 or Bazel 8.

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.9")

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.38.0",
    ],
    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.9"
RULES_JVM_EXTERNAL_SHA = "3c41eae4226a7dfdce7b213bc541557b8475c92da71e2233ec7c306630243a65"

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/bazel-contrib/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.38.0",
    ],
    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

  • Handle package in gradle versions files properly by @shs96c in #1419
  • Fetch transitive POMs in gradle resolver by @smocherla-brex in #1411
  • maven.override: make override alias preserve strict visibility of overridden target by @dmivankov in #1416
  • Indicate which install tag has duplicate coordinates by @shs96c in #1422
  • Require force_version for root module artifact to take precedence by @shs96c in #1423
  • Generate @package_metadata info for jvm_import targets by @Yannic in #1410
  • Write exclusions to pom.xml by @vinnybod in #1375
  • set -XX:+ExitOnOutOfMemoryError when invoking coursier by @mattnworb in #1433
  • Remove asc signatures on checksums in MavenPublisher by @l46kok in #1430
  • Add support for publishing maven-metadata.xml by @fzakaria in #1260
  • Maintain Starlark insertion order for repositories by @jjudd in #1447
  • Do not use import scope in dependencies by @honnix in #1432
  • Fix issue where MavenPublisher hangs indefinitely by @vinnybod in #1444
  • Expose CreateJar as a rule by @vinnybod in #1449
  • Add more unit tests for gradle resolver by @smocherla-brex in #1457
  • Ensure resolved artifact hash is calculated the same way in Java and Starlark by @shs96c in #1462
  • [gradle] Symlink user cache dir when RJE_UNSAFE_CACHE is set by @shs96c in #1448
  • Untangle resolvers by @shs96c in #1458
  • Ensure packaging is respected when resolving artifacts by @shs96c in #1463
  • ci: Enable Local test examples on macOS by @utzcoz in #1459
  • Handle all known variants used in gradle version catalogues by @shs96c in #1468
  • Fix gradle resolver to throw exception on unresolved dependencies by @smocherla-brex in #1466
  • Fix cycles with some dependencies with gradle resolver by @smocherla-brex in #1472

New Contributors

Full Changelog: 6.8...6.9

6.8

07 Jul 18:21
a88c56e

Choose a tag to compare

6.8

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 6.5.0, Bazel 7.6.1 or Bazel 8.

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.8")

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.28.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.8"
RULES_JVM_EXTERNAL_SHA = "704a0197e4e966f96993260418f2542568198490456c21814f647ae7091f56f2"

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/bazel-contrib/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.28.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

  • Implement different scope behavior for generated pom files by @vinnybod in #1336
  • Add support to outdated for BOMs by @cheister in #1341
  • Fix a fatal error when printing verbose logs when dependencies contain exclusions by @vinnybod in #1342
  • Use Bazel's JDK to run coursier by @cheister in #1323
  • Fix the docs to use the correct tag name by @chrismgrayftsinc in #1339
  • Pass boms during (unpinned) coursier fetch by @joca-bt in #1350
  • Use copy_file instead of a genrule to link things in the generated workspaces by @shs96c in #1361
  • Flip fail_if_repin_required to True by default by @shs96c in #1371
  • Avoid spurious warnings about poorly formatted artifact coordinates by @shs96c in #1374
  • Prepare for 6.8 release by @sumeetgajjar in #1380
  • Add support for gradle resolver by @smocherla-brex in #1357
  • Update maven-metadata.xml when publishing locally by @AustinSchuh in #1369
  • Ensure root module artifacts and boms take precedence with warnings by @shs96c in #1373
  • Allow root module's override tags to take precedence over the overridees from transitive deps. by @sumeetgajjar in #1381
  • Modify maven_export to allow exporting zip archives by @AustinSchuh in #1368
  • Allow package exclusions and inclusions in javadocs by @vinnybod in #1293
  • Allow coursier artifacts to have empty versions provided by BOMs and don't include them in outdated by @cheister in #1390
  • [bzlmod] Allow suppressing warning about multiple contributing modules. by @mkosiba in #1393
  • Remove dep on android ndk. by @jin in #1305
  • Add support for reading artifacts from a file by @shs96c in #1400

New Contributors

Full Changelog: 6.7...6.8

6.7

11 Feb 10:38
1811c0d

Choose a tag to compare

6.7

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 6.5.0, Bazel 7.5.0 or Bazel 8.

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.7")

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.28.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.7"
RULES_JVM_EXTERNAL_SHA = "a1e351607f04fed296ba33c4977d3fe2a615ed50df7896676b67aac993c53c18"

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/bazel-contrib/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.28.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

  • Fix docs generation for artifacts with compile only dependencies by @vinnybod in #1291
  • Update HEAD to support Bazel 6 -> Bazel 8. by @jin in #1294
  • Make multiple modules contributing to the same maven repo namespace warning less verbose and duplicated by @jin in #1295
  • Bump robolectric-bazel to 4.14.1.2 by @utzcoz in #1301
  • [auth][netrc] Empty account fallback to login by @stevebarrau in #1299
  • Fix collection of Maven runtime deps by @fmeum in #1308
  • Update protobuf to 29.3 (bzlmod only) by @joca-bt in #1314
  • Add support for using Maven BOMs with Coursier by @protocol7 in #1306
  • Give the coursier pin alias public visibility to match others by @erikkerber in #1319
  • Assume third part of coordinates is a version number by @shs96c in #1311

New Contributors

Full Changelog: 6.6...6.7

6.6

25 Nov 13:47
@jin jin
664b49e

Choose a tag to compare

6.6

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.6")

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.26.0",
    ],
    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.6"
RULES_JVM_EXTERNAL_SHA = "3afe5195069bd379373528899c03a3072f568d33bd96fe037bd43b1f590535e7"

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/bazel-contrib/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.26.0",
    ],
    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

Full Changelog: 6.5...6.6

6.5

30 Oct 15:38
1202665

Choose a tag to compare

6.5

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.5")

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.26.0",
    ],
    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.5"
RULES_JVM_EXTERNAL_SHA = "3a4d56357851cf5b0dae538b3f3e0612a4f58925dfb3cadb2e0c4e87d51e629e"

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/bazel-contrib/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.26.0",
    ],
    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

  • Fix @rules_kotiln reference in kt_jvm_export by @elwin in #1263
  • Do not use or recommend @// labels with Bzlmod by @fmeum in #1265
  • pass toolchains to maven_* rules by @elwin in #1264
  • Upgrade rules_java and add rule loads by @ted-xie in #1271
  • Bump rules_java 7.12.2 and .bazelversion 7.4.0 by @jin in #1273

New Contributors

Full Changelog: 6.4...6.5

6.4

18 Sep 13:19
8388bef

Choose a tag to compare

6.4

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.4")

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.4"
RULES_JVM_EXTERNAL_SHA = "85776be6d8fe64abf26f463a8e12cd4c15be927348397180a01693610da7ec90"

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/bazel-contrib/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

  • Fix the alias generated when using bzlmod and the maven resolver by @shs96c in #1249
  • Ensure that the pom classifier isn't always downloaded by @shs96c in #1251

Full Changelog: 6.3...6.4

6.3

12 Sep 09:33
2deeda5

Choose a tag to compare

6.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 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.3")

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.3"
RULES_JVM_EXTERNAL_SHA = "c18a69d784bcd851be95897ca0eca0b57dc86bb02e62402f15736df44160eb02"

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

  • Fix TOC entry for bzlmod usage by @jvolkman in #1194
  • Add a maven.artifact tag example into the bzlmod readme. by @jin in #1195
  • Update bzlmod.md to remove unpinned_maven by @mbland in #1198
  • Update bzlmod.md to reflect that gazelle support is now available by @chrismgrayftsinc in #1199
  • Track whether a repo is pinned or unpinned by explicit attr by @plobsing in #1204
  • Support plus as repo name delimiter in query-result normalization logic by @plobsing in #1211
  • Remove repositories attr from maven.artifact by @plobsing in #1202
  • [Upstream] Add pgp in memory signing support by @ThomasCJY in #1191
  • handle transitive dependencies of packaging=pom by @mattnworb in #1207
  • Upgrade rules_java to 7.10.0 by @comius in #1226
  • Retain comments / licenses in service provider files when merging jars by @vinnybod in #1123
  • Remove hardcoded javadocopts by @vinnybod in #1212
  • Add sha256 and sha512 to MavenPublisher by @vinnybod in #1240
  • Skip non-class files in the exclusions processing for MergeJars by @vinnybod in #1239
  • Add support for resources in javadoc jars and make variable substitution in javadoc arguments by @vinnybod in #1238
  • Allow jvm_import to accept a jar parameter by @shs96c in #1242
  • jvm_import and java_export targets now include a PackageInfo provider @shs96c in #1232

New Contributors

Full Changelog: 6.2...6.3

6.2

04 Jul 14:40
61e8eda

Choose a tag to compare

6.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 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.2")

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.2"
RULES_JVM_EXTERNAL_SHA = "808cb5c30b5f70d12a2a745a29edc46728fd35fa195c1762a596b63ae9cebe05"

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

  • Allow runtime deps to be expressed in generated pom.xml files by @vinnybod in #1113
  • Restore Target Uniqueness Guard in dependency_tree_parser.bzl by @jonshea in #1122
  • Add support for .netrc on Windows by @bartoszpop in #1127
  • Use customized repositories for rules_jvm_external's own dependencies by @honnix in #1133
  • maven_install: fail if 'repositories' attribute is empty by @mattnworb in #1135
  • Mark maven extension as reproducible by @fmeum in #1141
  • Propagate testonly attribute to generated plugins by @rdesgroppes in #1142
  • Pass additional coursier cli options by @honnix in #1137
  • Remove old comment about grpc-java and bzlmod by @benjaminp in #1143
  • Fix bzlmod lockfile always not up-to-date by @BoleynSu in #1171
  • Add RJE_VERBOSE output when a BOM version is overridden by an explicit dependency by @cheister in #1172
  • Keep BOM's dependencies ordered in the same way they are declared by @cheister in #1176
  • Allow maven.artifact to have an empty version so it will get its version from a BOM file by @cheister in #1183
  • Consolidate maven versions of classifiers for an artifact by @cheister in #1179

New Contributors

Full Changelog: 6.1...6.2