Skip to content
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

Merged

Conversation

jarmoniuk
Copy link
Contributor

  • 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

@slawekjaranowski please review

…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
@jarmoniuk
Copy link
Contributor Author

Also corrected the way how range was interpreted if also a concrete version was passed inside the VersionRange object.

@jarmoniuk jarmoniuk marked this pull request as draft January 2, 2023 17:00
@jarmoniuk jarmoniuk marked this pull request as ready for review January 2, 2023 17:01
@@ -184,7 +185,12 @@ public ArtifactVersions lookupArtifactVersions(
mavenSession.getRepositorySession(),
new VersionRangeRequest(
toArtifact(artifact)
.setVersion(versionRange != null ? versionRange.toString() : "(,)"),
.setVersion(ofNullable(versionRange)
.map(VersionRange::getRestrictions)
Copy link
Contributor Author

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);
Copy link
Contributor Author

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.

@slawekjaranowski slawekjaranowski linked an issue Jan 3, 2023 that may be closed by this pull request
@slawekjaranowski slawekjaranowski added this to the 2.15.0 milestone Jan 8, 2023
@slawekjaranowski slawekjaranowski merged commit 10f8af1 into mojohaus:master Jan 8, 2023
@jarmoniuk jarmoniuk deleted the issue-896-parents-not-seen branch January 8, 2023 18:37
srowen pushed a commit to apache/spark that referenced this pull request Mar 3, 2023
### 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 <yangjie01@baidu.com>
Signed-off-by: Sean Owen <srowen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

display-parent-updates does not show updates correctly
2 participants