Repository navigation
Closed
Labels
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.
Activity
Add flag to control native maven jar rule deprecation.
[-]--incompatible_remove_native_maven_jar[/-][+]incompatible_remove_native_maven_jar[/+]meteorcloudy commentedon Jan 3, 2019
This flag will break many projects in downstream, you can see the details at
https://buildkite.com/bazel/bazel-at-release-plus-incompatible-flags/builds/48
Please help them migrate (by filing issues and sending PRs and pinging the owners), thanks!
dkelmer commentedon Jan 16, 2019
Broken projects:
migration tooling: https://github.com/bazelbuild/migration-tooling(the project is deprecated and read only)rules_k8s: https://github.com/bazelbuild/rules_k8s(breaking because of dependency on grpc)meisterT commentedon Feb 3, 2019
cc @vladmos this is a classical example where buildifier could help with fixing the projects, because it's a mostly mechanical change
Danna: it would be great if we could prioritize this migration, because the maven rules are one of the two "users" of the java.desktop module which contributes to 1/3 of the embedded JDK size.
Stop using native maven_jar rule
dkelmer commentedon Feb 6, 2019
merged: bazelbuild/rules_gwt#20
merged: bazelbuild/rules_appengine#96
merged: https://critique.corp.google.com/#review/229611659&tab=a (intellij, SOT is internal)
merged: grpc/grpc-java#5327
merged: android/testing-samples#245
filed issue: bazelbuild/BUILD_file_generator#48 (they use bazel-deps and updating requires updating their custom scripts so I'll leave that to them)
rules_k8s is breaking because of grpc, so marking it as fixed
Stop using native maven_jar rule (#20)
Stop using maven_jar in android-testing
43 remaining items
jin commentedon Oct 30, 2019
Please see this document for a design proposal for a migration tool from
maven_jartorules_jvm_external.JLLeitschuh commentedon Oct 31, 2019
Thanks! Cool to see progress on this!
jin commentedon Nov 14, 2019
The automated migration tool is available here: https://github.com/bazelbuild/rules_jvm_external/tree/master/migration
If you don't wish to migrate to
rules_jvm_external, please follow the alternative instructions to manually migrate tojvm_maven_import_external.Replace maven_jar with maven_install
Replace maven_jar with maven_install
Release 2.0.0 (2019-12-19)
Remove use of maven_jar.
Release 2.0.0 (2019-12-19)
Remove incompatible native.maven_jar usage (#127)
Stop using maven_jar in android-testing