简体   繁体   English

Sonatype Nexus获得最新的jar-with-dependencies

[英]Sonatype Nexus get latest jar-with-dependencies

Hitting a bit of a roadblock when trying to download a snapshot jar with dependencies. 尝试下载具有依赖项的快照jar时遇到了一些障碍。 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 . 正常情况下,Nexus的REST API为您将“ SNAPSHOT”扩展为正确的日期时间戳-但是,如果下载具有依赖项的jar,则文本-jar-with-dependencies跟随由SNAPSHOT替代的日期。 It's not clear to me how to communicate this unusual name situation to Nexus' REST API - has anyone encountered/worked around this? 我目前还不清楚如何将这种不寻常的名称情况传达给Nexus的REST API-是否有人遇到过/解决过此问题?

Looking at the artifact in Nexus revealed that its coordinates included a 查看Nexus中的工件,发现其坐标包括

<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 瞧瞧,可以正确地将其捕捉到REST API中: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. 分类器是第4个Maven坐标,用于区分各种“附加”工件。 An attached artifact is anything other than the primary artifact built by the maven project, typically a jar file. 附加的工件不是maven项目构建的主要工件,通常是jar文件。

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. 在第二个jar中找到Java的源文件的位置。 In your case, the jar-with-dependencies is the name of the maven assembly that builds a jar with all of its dependencies. 在您的情况下, jar-with-dependencies是使用所有依赖项构建jar的maven程序集的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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