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

Can not build small library after upgrade rules to 6.1 #1177

Open
farcop opened this issue Jun 20, 2024 · 2 comments
Open

Can not build small library after upgrade rules to 6.1 #1177

farcop opened this issue Jun 20, 2024 · 2 comments

Comments

@farcop
Copy link

farcop commented Jun 20, 2024

# MODULE.bazel
bazel_dep(name = "rules_java", version = "7.6.4")
bazel_dep(name = "rules_jvm_external", version = "6.1")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")

version_keycloak = "23.0.7"

maven.install(
    artifacts = [
        "jakarta.ws.rs:jakarta.ws.rs-api:3.1.0",
    ],
    fail_if_repin_required = True,
    lock_file = "//:maven_install.json",
)

[
    maven.artifact(
        artifact = artifact,
        group = "org.keycloak",
        neverlink = True,
        version = version_keycloak,
    )
    for artifact in [
        "keycloak-core",
        "keycloak-model-jpa",
        "keycloak-server-spi",
        "keycloak-server-spi-private",
    ]
]

use_repo(maven, "maven", "unpinned_maven")
# BUILD
load("@rules_java//java:defs.bzl", "java_library")

java_library(
    name = "jar",
    srcs = glob(["src/main/java/org/keycloak/kublr_extension/**/*.java"]),
    resources = glob(["src/main/resources/META-INF/**/*"]),
    deps = [
        "@maven//:jakarta_ws_rs_jakarta_ws_rs_api",
        "@maven//:org_keycloak_keycloak_core",
        "@maven//:org_keycloak_keycloak_model_jpa",
        "@maven//:org_keycloak_keycloak_server_spi",
        "@maven//:org_keycloak_keycloak_server_spi_private",
    ],
)

After upgrade to 6.1 I updated MODULE.bazel.lock successfully
bazel mod deps --lockfile_mode=update

But when I try to build I got error...

bazel build //images/keycloak/kublr-extension:jar
ERROR: Analysis of target '//images/keycloak/kublr-extension:jar' failed; build aborted: MODULE.bazel.lock is no longer up-to-date because: The repo mappings of certain repos used by the extension 'ModuleExtensionId{bzlFileLabel=@@rules_jvm_external~//:extensions.bzl, extensionName=maven, isolationKey=Optional.empty}' have changed. Please run `bazel mod deps --lockfile_mode=update` to update your lockfile.
INFO: Elapsed time: 0.153s, Critical Path: 0.04s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully

This project successfully builds with rules version 6.0

@farcop farcop changed the title Can not build small module after upgrade rules to 6.1 Can not build small library after upgrade rules to 6.1 Jun 20, 2024
@BoleynSu
Copy link
Contributor

Fixed by #1171

@farcop
Copy link
Author

farcop commented Jun 23, 2024

Can confirm fix. Just test with single_version_override() with patch
Waiting for release...
@BoleynSu Thank you!

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