Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] How to retrieve the LATEST (also SNAPSHOT) version of a maven artifact using aether API?

LATEST is broken by design !!!!

On Fri, Dec 12, 2014 at 9:27 AM, Mario Fusco <mario.fusco@xxxxxxxxx> wrote:

I'm using eclipse.aether (version 1.0.0.v20140518) to programmatically fetch some maven artifacts from my repository. To do this I am using the following code:

Artifact artifact = new DefaultArtifact( artifactName );
ArtifactRequest artifactRequest = new ArtifactRequest().setArtifact( artifact );
repositorySystem.resolveArtifact(session, artifactRequest);

where artifactName is a String in the format "groupId:artifactId:version". When version is a fixed version (like in "org.myNamespace:myProject:1.0.0") everything works fine. Moreover I should be allowed also to replace the fixed version with "LATEST" (as in "org.myNamespace:myProject:LATEST") and in this case it should load the latest version of that artifact in my repository.

This also works but only partially, meaning that it never retrieves SNAPSHOTs artifacts, but only releases. This doesn't seem to be compliant with maven semantic as it is also described here How do I tell Maven to use the latest version of a dependency?

Am I doing something wrong? Is there a way to load the latest version of an artifact regardless if it is a release or a snapshot?

Thanks in advance for your help,
Mario

_______________________________________________
aether-users mailing list
aether-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aether-users



--
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

Back to the top