-
Notifications
You must be signed in to change notification settings - Fork 455
Show impact of a possible ResolutionStrategy implementation #5891
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: main
Are you sure you want to change the base?
Conversation
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.
Some suggestions could not be made:
- rewrite-maven/src/main/java/org/openrewrite/maven/internal/VersionRequirement.java
- lines 68-67
- lines 82-81
- lines 97-96
return builder.toString(); | ||
} | ||
|
||
public NearestWins addRequirement(String requested) { |
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.
public NearestWins addRequirement(String requested) { | |
@Override | |
public NearestWins addRequirement(String requested) { |
} | ||
} | ||
|
||
protected @Nullable String cacheResolved(DownloadOperation<Iterable<String>> availableVersions) throws MavenDownloadingException { |
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.
protected @Nullable String cacheResolved(DownloadOperation<Iterable<String>> availableVersions) throws MavenDownloadingException { | |
@Override | |
protected @Nullable String cacheResolved(DownloadOperation<Iterable<String>> availableVersions) throws MavenDownloadingException { |
import java.util.HashSet; | ||
import java.util.Iterator; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; |
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.
import java.util.stream.Collectors; | |
import static java.util.stream.Collectors.joining; |
|
||
@Override | ||
public String toString() { | ||
return requestedVersions.stream().map(Object::toString).collect(Collectors.joining(", ")); |
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.
return requestedVersions.stream().map(Object::toString).collect(Collectors.joining(", ")); | |
return requestedVersions.stream().map(Object::toString).collect(joining(", ")); | |
@Override |
return new SoftRequirement(requested); | ||
} | ||
|
||
protected @Nullable String cacheResolved(DownloadOperation<Iterable<String>> availableVersions) throws MavenDownloadingException { |
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.
protected @Nullable String cacheResolved(DownloadOperation<Iterable<String>> availableVersions) throws MavenDownloadingException { | |
@Override | |
protected @Nullable String cacheResolved(DownloadOperation<Iterable<String>> availableVersions) throws MavenDownloadingException { |
@@ -0,0 +1,6 @@ | |||
package org.openrewrite.maven.tree; |
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.
package org.openrewrite.maven.tree; | |
/* | |
* Copyright 2025 the original author or authors. | |
* <p> | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* <p> | |
* https://www.apache.org/licenses/LICENSE-2.0 | |
* <p> | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
* See the License for the specific language governing permissions and | |
* limitations under the License. | |
*/ | |
package org.openrewrite.maven.tree; |
@@ -0,0 +1,387 @@ | |||
package org.openrewrite.maven.tree; |
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.
package org.openrewrite.maven.tree; | |
/* | |
* Copyright 2025 the original author or authors. | |
* <p> | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* <p> | |
* https://www.apache.org/licenses/LICENSE-2.0 | |
* <p> | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
* See the License for the specific language governing permissions and | |
* limitations under the License. | |
*/ | |
package org.openrewrite.maven.tree; |
} | ||
} | ||
} | ||
} |
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.
} | |
} |
DO NOT MERGE
What's changed?
After the previous PR we've mentioned implementation of something like a
ResolutionStrategy
would come in handy for later purposes. This PR adds the ResolutionStrategiesNewest_Wins
andNearest_Wins
.Anyone you would like to review specifically?
@sambsnyd
Any additional context
If we want to support Gradle specific behavior further, we should still have to add support for a
VersionSpec
that is able to work with+
.Checklist