-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Labels
P1I'll work on this now. (Assignee required)I'll work on this now. (Assignee required)incompatible-changeIncompatible/breaking changeIncompatible/breaking change
Description
The native maven_jar rule will no longer be available with this flag set to true.
(Update: managed by @jin as of July 12)
A migration tool will be provided to automatically convert maven_jar targets to rules_jvm_external's maven_install rule, and modify BUILD files to use the new labels.
See https://docs.google.com/document/d/1CqxPv-TwvFWBHgtg7_QhVfck4vH4rnmCU_IuMdC7O2M/edit# for a design document of this migration tool.
Proposal by @dkelmer as of Nov 28, which is another valid migration solution that is done manually:
Use
load("@bazel_tools//tools/build_defs/repo:java.bzl", "java_import_external")or the convenience wrapper
load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")instead.
Given a WORKSPACE file that looks like the following:
maven_jar(
name = "truth",
artifact = "com.google.truth:truth:0.30",
sha1 = "9d591b5a66eda81f0b88cf1c748ab8853d99b18b",
)It will need to look like this after updating:
load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
jvm_maven_import_external(
name = "truth",
artifact = "com.google.truth:truth:0.30",
artifact_sha256 = "59721f0805e223d84b90677887d9ff567dc534d7c502ca903c0c2b17f05c116a",
server_urls = ["http://central.maven.org/maven2"],
licenses = ["notice"], # Apache 2.0
)Notably
- the
licensesattribute is mandatory - sha1 is no longer supported, only sha256 is
- the
server_urlsattribute is mandatory. If yourmaven_jarrule did not specify a url
then you should use the default server ("http://central.maven.org/maven2"). If your rule
did specify a url then keep using that one.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1I'll work on this now. (Assignee required)I'll work on this now. (Assignee required)incompatible-changeIncompatible/breaking changeIncompatible/breaking change