Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven command line to download latest snapshot with timestamp

I tried using this:

mvn dependency:get -DrepoUrl=http://myserver/artifactory -Dartifact=com.mypackage:my-package-name:1.0.0

However it just downloaded the pom.xml in my artifactory i have my-package-name-1.0.0-20120328.121341-3.jar

what i wish the command line to do is to download the snapshot with latest snapshot (without specifying the snapshot timestamp in the command line ofcourse). can anyone let me know how to do it?

thanks

like image 258
Jas Avatar asked Mar 29 '12 13:03

Jas


1 Answers

Append -SNAPSHOT to the version you specify.

That is, you now request version 1.0.0 which is a release version, but the artifact you want is a unique snapshot. If you request version 1.0.0-SNAPSHOT, you're practically telling Maven that you want the latest snapshot version of 1.0.0 with no special preference.

Maven will resolve the artifact's Maven metadata from Artifactory and pick the latest snapshot file to download.

like image 102
noamt Avatar answered Oct 27 '22 00:10

noamt