Skip to content

Releases: bazel-contrib/rules_jvm_external

6.5

30 Oct 15:38
1202665
Compare
Choose a tag to compare

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
Compare
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
Compare
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
Compare
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

6.1

26 Apr 05:49
b4321ee
Compare
Choose a tag to compare
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

New Contributors

Full Changelog: 6.0...6.1

6.0

18 Jan 12:09
e4bfab1
Compare
Choose a tag to compare
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

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 other javadoc 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

23 Jun 14:57
e6c1ff2
Compare
Choose a tag to compare
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

What's Changed

New Contributors

Full Changelog: 5.2...5.3

5.2

13 Apr 14:25
1da66b3
Compare
Choose a tag to compare
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

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

08 Mar 14:12
3cb8783
Compare
Choose a tag to compare
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 from maven_install

New Contributors

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 is None 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

07 Mar 18:02
2e92f50
Compare
Choose a tag to compare
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 from maven_install

What's Changed

New Contributors

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 is None 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