Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error repinning with maven resolver #1205

Open
peakschris opened this issue Jul 25, 2024 · 2 comments
Open

Error repinning with maven resolver #1205

peakschris opened this issue Jul 25, 2024 · 2 comments

Comments

@peakschris
Copy link

I'm seeing this issue with rules_jvm_external 6.1 and also 6.2:

set REPIN=1
bazel run @maven//:pin
ERROR: Traceback (most recent call last):
        File "D:/udu/b/qpawu7hm/external/rules_jvm_external~/private/extensions/maven.bzl", line 438, column 45, in _maven_impl
                unpinned_maven_pin_command_alias(
Error in repository_rule: no repository visible as '@maven' to the repository '@@rules_jvm_external~', but referenced by label '@maven//:pin' in attribute 'alias' of unpinned_maven_pin_command_alias 'unpinned_maven'. Is the module 'rules_jvm_external' missing a bazel_dep or use_repo(..., "maven")?

my MODULE.bazel is:

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
    name = "maven",
    artifacts = [
        <snip>
    ],
    repositories = [
         "https://artifactory.internal/maven",
    ],
    resolver = "maven",
    fail_on_missing_checksum = False,
    strict_visibility = True,
    generate_compat_repositories = False,
    fail_if_repin_required = True,
    lock_file = "//src/path/to:maven_install.json",
    # use the exact versions for any artifacts explicltly specified above
    version_conflict_policy = "pinned",
    repin_instructions = "bb maven repin",
    additional_netrc_lines = ["credentials"],
)

use_repo(maven, "maven")
@SanjayVas
Copy link

SanjayVas commented Aug 30, 2024

This error happens even when just trying to update the Bazel lockfile (MODULE.bazel.lock) via bazel mod deps --lockfile_mode=update and not using pinning. More specifically, I get the above error when using Bazel 7.3.1. If I use 7.1.0, I get the following error instead:

ERROR: module extension "maven" from "@@rules_jvm_external~//:extensions.bzl" does not generate repository "maven", yet it is imported as "maven"

@SanjayVas
Copy link

This appears to be the issue: https://github.com/bazelbuild/rules_jvm_external/blob/61e8eda72f8cafcecf8b2aef0ef62dd58bfa953d/private/extensions/maven.bzl#L436-L441

I was able to get it working by patching that out locally.

SanjayVas added a commit to world-federation-of-advertisers/bazel-registry that referenced this issue Sep 3, 2024
This is a patched version of 6.2 to work around bazel-contrib/rules_jvm_external#1205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants