HADOOP-18006. maven-enforcer-plugin's execution of banned-illegal-imports gets overridden in child poms#3648
Merged
tasanuma merged 2 commits intoapache:trunkfrom Nov 15, 2021
Conversation
…orts gets overridden in child poms
Member
|
@virajjasani Thanks for reporting the problem. It seems we have no choice but remove them. +1, pending Jenkins.
+1 for this plan. @amahussein Could you review it too? |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
Contributor
|
Thanks @virajjasani for reporting this. |
Contributor
Author
|
Thanks for the reviews @amahussein @tasanuma |
Member
|
Merged it. Thanks for your contribution, @virajjasani. Thanks for your review, @amahussein. |
HarshitGupta11
pushed a commit
to HarshitGupta11/hadoop
that referenced
this pull request
Nov 28, 2022
…orts gets overridden in child poms (apache#3648) Reviewed-by: Ahmed Hussein <ahussein@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
When we specify any maven plugin with execution tag in the parent as well as child modules, child module plugin overrides parent plugin. For instance, when banned-illegal-imports is applied for any child module with only one banned import (let’s say Preconditions), then only that banned import is covered by that child module and all imports defined in parent module (e.g Sets, Lists etc) are overridden and they are no longer applied.
As of today, hadoop-hdfs module will not complain about Sets even if i import it from guava banned imports but on the other hand, hadoop-yarn module doesn’t have any child level banned-illegal-imports defined so yarn modules will fail if Sets guava import is used.
So going forward, it would be good to replace guava imports with Hadoop’s own imports module-by-module and only at the end, we should add new entry to parent pom banned-illegal-imports list.
For code changes: