简体   繁体   中英

Sonatype Nexus get latest jar-with-dependencies

Hitting a bit of a roadblock when trying to download a snapshot jar with dependencies. Normally Nexus' REST API expands the "SNAPSHOT" into the correct date time stamp for you - however if downloading a jar with dependencies the text -jar-with-dependencies follows the date substituted in by SNAPSHOT . It's not clear to me how to communicate this unusual name situation to Nexus' REST API - has anyone encountered/worked around this?

Looking at the artifact in Nexus revealed that its coordinates included a

<classifier>jar-with-dependencies</classifier>

Field. Lo and behold this snaps into the REST API correctly: http://yourdomain.com:8081/nexus/nexus-rrb-plugin/default/docs/index.html

You have to specify the classifier parameter. That bit after the version number, and prior to the extension, is always the classifier. The classifier is the 4th maven coordinate and it is used to distinguish between various "attached" artifacts. An attached artifact is anything other than the primary artifact built by the maven project, typically a jar file.

The most often seen example is:

myArtifact-1.0.0.jar
myArtifact-1.0.0-sources.jar

Where the source files for the java are found in the second jar. In your case, the jar-with-dependencies is the name of the maven assembly that builds a jar with all of its dependencies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM