Skip to content

Commit

Permalink
Update to rules_jvm_external 6.2, repin maven deps
Browse files Browse the repository at this point in the history
- https://github.com/bazelbuild/rules_jvm_external/releases/tag/6.2

This new version resolves the issue mentioned in #182:

- bazel-contrib/rules_jvm_external#1189

Fixed by:

- bazel-contrib/rules_jvm_external#1122

Per my comment on that issue, source JARs are no longer fetched without
explicitly setting `fetch_sources = True`. This is why they no longer
appear in `maven_install.json`.

Finally, @shs96c noted to me in private that:

> ...with recent `rules_jvm_external` releases, all you need to update
> is `bazel run @maven//:pin`. There’s no need for the `unpinned_maven`
> repo any more.

I removed the `unpinned_maven` repo and ran `REPIN=1 bazel run
@maven//:pin` to regenerate `maven_install.json`. This also removed the
`unpinned_maven` entries from `MODULE.bazel.lock`.

I'll update this section of my Bzlmod migration blog post after merging
this change:

- https://blog.engflow.com/2024/06/27/migrating-to-bazel-modules-aka-bzlmod---the-easy-parts/#with-rules_jvm_external

Signed-off-by: Mike Bland <mbland@engflow.com>
  • Loading branch information
mbland committed Jul 8, 2024
1 parent ddc353f commit cbbf59c
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 1,879 deletions.
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module(
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_jvm_external", version = "5.3")
bazel_dep(name = "rules_jvm_external", version = "6.2")
bazel_dep(name = "rules_proto", version = "6.0.2")
bazel_dep(name = "protobuf", version = "27.2")

Expand All @@ -34,11 +34,11 @@ maven.install(
"junit:junit:4.13.2",
"org.mockito:mockito-core:5.12.0",
],
# When updating versions, run `REPIN=1 bazel run @unpinned_maven//:pin`
# When updating versions, run `REPIN=1 bazel run @maven//:pin`
fail_if_repin_required = True,
lock_file = "//:maven_install.json",
repositories = [
"https://repo1.maven.org/maven2",
],
)
use_repo(maven, "maven", "unpinned_maven")
use_repo(maven, "maven")
Loading

0 comments on commit cbbf59c

Please sign in to comment.