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

Using RepositorySystem.resolveVersion to "lock snapshots" #900

Closed

Conversation

jarmoniuk
Copy link
Contributor

As per javadoc,

    /**
     * Resolves an artifact's meta version (if any) to a concrete version. For example, resolves "1.0-SNAPSHOT" to
     * "1.0-20090208.132618-23".
     * 
     * @param session The repository session, must not be {@code null}.
     * @param request The version request, must not be {@code null}.
     * @return The version result, never {@code null}.
     * @throws VersionResolutionException If the metaversion could not be resolved.
     * @see #newResolutionRepositories(RepositorySystemSession, List)
     */
    VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request )
        throws VersionResolutionException;

This could do the trick, but I have no means to test it. Can't make mrm-maven-plugin work with maven-metadata.xml: don't know where to put it.

So, I don't have any pom.xml to test it against.

@jarmoniuk jarmoniuk force-pushed the issue-899-lock-snapshots branch 2 times, most recently from cc0da42 to 782dbd0 Compare January 7, 2023 07:59
@jarmoniuk jarmoniuk marked this pull request as ready for review January 7, 2023 08:18
@jarmoniuk
Copy link
Contributor Author

jarmoniuk commented Jan 7, 2023

@slawekjaranowski please review.

It would be ideal if the Resolver method https://maven.apache.org/resolver/maven-resolver-api/apidocs/org/eclipse/aether/RepositorySystem.html#resolveVersion(org.eclipse.aether.RepositorySystemSession,org.eclipse.aether.resolution.VersionRequest) be tested too, but it's rather a test of the Resolver itself.

Edit: Ah, perhaps the its's simply not supported by mrm: mojohaus/mrm#22

…ve the timestamped snapshot version; added unit tests for LockSnapshotsMojo for the case when no timestamped versions are found
@jarmoniuk
Copy link
Contributor Author

@slachiewicz @slawekjaranowski could someone restart the job?

@jarmoniuk
Copy link
Contributor Author

Looks like Github CI is fixed. Could you please restart the jobs? @slachiewicz

@jarmoniuk jarmoniuk closed this Jan 8, 2023
@jarmoniuk jarmoniuk deleted the issue-899-lock-snapshots branch January 8, 2023 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant