-
-
Notifications
You must be signed in to change notification settings - Fork 268
Require force_version
for root module artifact to take precedence
#1423
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
base: master
Are you sure you want to change the base?
Conversation
…ake precedence # Conflicts: # private/extensions/maven.bzl
Note, this builds on #1422 so only the commits after "fix a thinko" need to be reviewed as part of this PR. |
@@ -292,7 +301,7 @@ def _deduplicate_artifacts_with_root_priority(root_artifacts, non_root_artifacts | |||
else: | |||
warning_parts.append(maven_module) | |||
|
|||
print("WARNING: The following maven modules appear in multiple sub-modules with potentially different versions. " + | |||
print("WARNING: The following coordinates from `%s` appear in multiple sub-modules with potentially different versions. " % name + | |||
"Consider adding one of these to your root module to ensure consistent versions:\n\t%s" % |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this message be updated to tell people they'll need force_version=True for the coordinates in the root module?
@@ -18,6 +18,7 @@ maven.artifact( | |||
exclusions = ["com.google.code.findbugs:jsr305"], | |||
group = "com.google.guava", | |||
version = "31.1-jre", | |||
force_version = True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should force_version be in sorted order after exclusions?
There was concern expressed by some owners of sub-modules that deliberately contribute to the
maven
repo that the behaviour of implicitly overriding artifacts by merely listing them in the root module would lead to users accidentally overriding those values. Instead, require the root module to useforce_version
to override the specific coordinate, which is more inline with the original intention offorce_version
.