-
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
Fixes #896: Fixing available version retrieval; enabling allowSnapshots #897
Fixes #896: Fixing available version retrieval; enabling allowSnapshots #897
Conversation
…wSnapshots - Version range should not be specified in the retrieval at all; removed. - If provided, the actual version range restriction should be used, and not the result of the toString() method - Also, allowSnapshots was ignored for the mojo; corrected
Also corrected the way how range was interpreted if also a concrete version was passed inside the VersionRange object. |
@@ -184,7 +185,12 @@ public ArtifactVersions lookupArtifactVersions( | |||
mavenSession.getRepositorySession(), | |||
new VersionRangeRequest( | |||
toArtifact(artifact) | |||
.setVersion(versionRange != null ? versionRange.toString() : "(,)"), | |||
.setVersion(ofNullable(versionRange) | |||
.map(VersionRange::getRestrictions) |
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.
Here we're using the restriction present in the Version range object if it's present instead of the concrete version.
.withType("pom") | ||
.build()); | ||
|
||
ArtifactVersion artifactVersion; | ||
try { | ||
artifactVersion = findLatestVersion(artifact, versionRange, null, false); | ||
artifactVersion = findLatestVersion(artifact, null, allowSnapshots, false); |
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.
We're never actually interested in range-restricted versions; removing.
### What changes were proposed in this pull request? This pr aims upgrade `versions-maven-plugin` to 2.15.0 ### Why are the changes needed? New version bring some improvements like: - mojohaus/versions#898 - mojohaus/versions#883 - mojohaus/versions#878 - mojohaus/versions#893 and some bug fix: - mojohaus/versions#901 - mojohaus/versions#897 - mojohaus/versions#891 The full release notes as follows: - https://github.com/mojohaus/versions/releases/tag/2.15.0 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? - GA `Dependencies test` should work normally - Manually check `./dev/test-dependencies.sh --replace-manifest`, run successful Closes #40248 from LuciferYang/SPARK-42648. Authored-by: yangjie01 <[email protected]> Signed-off-by: Sean Owen <[email protected]>
@slawekjaranowski please review