maven_install artifact with classifier

183 views
Skip to first unread message

Robert Cauble

unread,
Sep 17, 2022, 10:15:24 AM9/17/22
to bazel-discuss
Hi,

One of my artifacts in the maven_install has a maven classifier. I tried a couple of things and neither seems to work:

1) <groupid>:<artifactid>:<classifier>:<version>
2) <groupid>:<artifactid>:<version>-<classifier>

In case #1, it seems to completely ignore the classifier: build succeeds but when I look at the filesystem in ~/.cache/bazel, I only get the non-classified artifact.

In case#2, it fails with an error indicating it couldn't find the arifact.

Any ideas?

Thanks,
Rob


Robert Cauble

unread,
Sep 17, 2022, 9:28:48 PM9/17/22
to bazel-discuss
Found something that works. I ended up using the maven.artifact utility rather than specifying in string format and that did the trick:

load("@rules_jvm_external//:defs.bzl", "maven_install")
load("@rules_jvm_external//:specs.bzl", "maven")

maven_install(
    artifacts = [
        maven.artifact(
            group="<group>",
            artifact="<artifact>",
            version="<version>",
            classifier="<classifier>")
    ]
...
)

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/d955d7fc-b1b7-4398-a0e2-8594aad42b4en%40googlegroups.com.

Robert Cauble

unread,
Sep 17, 2022, 9:56:57 PM9/17/22
to bazel-discuss
Also found the code here and figured out what I was missing previously: https://github.com/bazelbuild/rules_jvm_external/blob/master/specs.bzl#L132

With this syntax it works:

<groupid>:<artifactid>:<packaging>:<classifier>:<version>
Reply all
Reply to author
Forward
0 new messages