-
Notifications
You must be signed in to change notification settings - Fork 23
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
[MPOM-288] - Update m-plugin-p to 3.6.4 #63
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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 the scope be managed as "provided" for this case?
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 be
provided
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.
If this was in the regular
<dependencies>
, I would agree with those users above who suggested adding theprovided
scope. However, this is in the<dependencyManagement>
section. Adding the scope there would override the defaultcompile
scope that most people omit when they actually use a dependency in the regular<dependencies>
section in their own POM. Changing that behavior so it'sprovided
instead ofcompile
can be very confusing to users, and to avoid that confusion, they will redundantly specify the scope themselves anyway. So, placing it here can create confusion, and doesn't really offer much benefit.So, I don't think the parent POM should manage the scope for the users in a
<dependencyManagement>
section. Instead, the scope should be omitted here, as it currently is, so it defaults tocompile
like users expect when they omit the scope. If they want to mark itprovided
, or any other scope, they should specify the scope themselves when they declare the dependency in their regular<dependencies>
section of their own POM.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.
This particular dependency should IMHO never be used with another scope, so this may warrant to set scope in depMgmt
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.
@kwin Even if it is extremely unlikely (I'm not going to say never, because people are creative), it's still going to create confusion, because people assume if the scope isn't specified, it is
compile
. Maven is built around a certain amount of convention. The more you break those conventions, the more it gets confusing.For the users who might actually want it in the
compile
scope, you're really creating a problem for them, because now they have to explicitly add<scope>compile</scope>
... and they probably have to leave a comment in for other developers, because lots of developers would just delete that line because they know it's not necessary most of the time.If users actually want it to be
provided
(and yeah, they probably would much of the time for this one), then they're probably going to set it explicitly anyway. When they do, the one in the<dependencyManagement>
section is redundant and adds no value.So, best case scenario, when users are following conventions, it does not serve a purpose because it's redundant. Worst case scenario, you're really screwing with people's understanding of Maven because you've broken a pretty widely known convention.
The
<dependencyManagement>
section is useful when it helps with dependency convergence (version management, transitive dependency exclusions, etc.). But setting the scope there severely disrupts conventions and has substantial downstream impact on anybody using this as a parent POM, because it quite literally alters their class paths.I strongly advise against breaking conventions like this in such a widely used parent POM that could break people's understanding of how Maven works, or messes with which jars are available in which class paths. In general, I strongly recommend against setting the scope in any
<dependencyManagement>
section, unless it's<type>pom</type>
and<scope>import</scope>
.