-
Notifications
You must be signed in to change notification settings - Fork 267
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
Resolves #387: Provide an enforcer rule to specify the maximum number of allowed dependency updates #801
Conversation
65e3adf
to
19498f9
Compare
One big difference is lack of segment controls like e.g. allowMinorUdates in the display dependency updates goal. I'm thinking of maybe adding such controls, i.e. ignoreMinorUpdates, ignoreIncrementalUpdates, and ignoreSubincrementalUpdates. What do you think? -> Converting back to draft. |
19498f9
to
b571516
Compare
Implemented the three "ignore-" parameters. I think it's ready now. I'll integrate the changes from #797 once it's merged in. |
b571516
to
d84f9ae
Compare
Oh and regarding this: .filter( dep -> finalDependencyManagement.parallelStream()
.noneMatch( depMan -> dependenciesMatch( dep, depMan ) ) ) The above filters out dependency management from dependencies. The code replaces a lengthier method doing the same using a for iterator with a "terminator" variable. Why it was done in the first place I can only speculate about. I think it's so that the dependency updates from dependencyManagemnt are not repeated in the depenedencies section. If so, why isn't the same done wrt other sections -- that I don't know. |
d84f9ae
to
74048e9
Compare
Moved |
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.
I think it will be to more complicated ... many configuration options will not be accepted like ruleSets ...
Maybe easier will be introduce new goal to existing plugin ...
src/main/java/org/apache/maven/plugins/enforcer/MaxDependencyUpdates.java
Outdated
Show resolved
Hide resolved
I still not convinced for such solution. When user has configuration for versions-m-p like ruleSet and so on ... In such case maintain configuration in double place is difficult to maintenance. |
My problem with using display-dependency-updates to enforce a number of dependencies is that display-dependency-updates does not have "ignore...updates" options. "allow...updates" options have opposite semantics. It's like "include" vs "exclude". So, one cannot copy the options for one goal to another. Display-dependency-updates allows ignoring the most major segemnts: But here we need to be able to ignore the least major ones: That, plus the purpose of enforcing a number of updates is different. A lot of the functionality is similar, to I abstracted that and moved it to that static utility class. |
a2f0d3a
to
82426ce
Compare
I'll check later what went wrong there |
Soooo... I was a bit too optimistic with taking the enforcer-rule out to its own module. Too early for that. The rule needs to use some functionality from VersionsHelper, but the plugin also needs to package the rule, so it needs to depend on it. So, this is a circular dependency. So, I'm putting it back until we extract the api to its own module. Second stage of the module split:
The above is a discussion on its own, but right now, the api package is also not really mature -- it contains some API, but it also contains API implementation and utilities. Also, I think VersionsHelper and AbstractArtifactVersions seem to serve a very similar purpose. |
82426ce
to
32acd63
Compare
a553b84
to
5c1521b
Compare
@slawekjaranowski rebased with master. Please review. |
5c1521b
to
e5d339e
Compare
e5d339e
to
ecdcea5
Compare
@slawekjaranowski should I make any more changes to this PR (apart from resolving merge conflicts)? |
56e12d6
to
a64bb42
Compare
So, I've waited with this quite some time as well, and it's also been increasingly more cumbersome to resolve all conflicts. Please review again and merge @slawekjaranowski |
versions-common/src/main/java/org/codehaus/mojo/versions/filtering/DependencyFilter.java
Show resolved
Hide resolved
versions-common/src/main/java/org/codehaus/mojo/versions/utils/MavenProjectUtils.java
Outdated
Show resolved
Hide resolved
versions-common/src/main/java/org/codehaus/mojo/versions/utils/MavenProjectUtils.java
Show resolved
Hide resolved
versions-maven-plugin/src/it/it-max-dependency-updates-001/pom.xml
Outdated
Show resolved
Hide resolved
versions-maven-plugin/src/it/it-max-dependency-updates-001/pom.xml
Outdated
Show resolved
Hide resolved
versions-maven-plugin/src/test/resources/org/codehaus/mojo/max-dependency-upgrades/pom.xml
Outdated
Show resolved
Hide resolved
a64bb42
to
0f9bd76
Compare
Changes applied, please re-review/merge. |
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.
IT test for enforcer should be in versions-enforcer
module
Now under test latest version of tested artifact is downloaded from remote repo
or used from previous build from local repository
versions-enforcer/src/main/java/org/apache/maven/plugins/enforcer/MaxDependencyUpdates.java
Outdated
Show resolved
Hide resolved
4b7621f
to
3d80c90
Compare
@slawekjaranowski changes applied. One question remaining regarding the version of |
3d80c90
to
be0fe63
Compare
…number of allowed dependency updates
be0fe63
to
87cc6e7
Compare
@slawekjaranowski changes applied where possible (one was not possible -- yet) |
Please review @slawekjaranowski