Artifactory或Nexus部署Jar和Pom

时间:2014-12-28 00:13:47

标签: maven curl nexus artifactory sonatype

我有一个已编译的Jar文件和一个Pom文件。现在我想将这两个部署到Artifactory或Nexus(我有两个)。

我想用mvn:deploy或curl(REST API)

来做

有人可以告诉我我是怎么做到的吗?

2 个答案:

答案 0 :(得分:0)

我的答案当然是关于Artifactory的。

要使用mvn deploy,您需要配置pom文件以包含distributionManagement标记。是ou can copy-paste the whole tag from Artifactory UI(单击要部署到的存储库,在右侧,您将看到distributionMnagement标记进行复制。

使用REST API,您只需发出两个PUT requests(一个用于pom,另一个用于jar)。从pom开始。

答案 1 :(得分:0)

如果你已经有一个jar文件和一个pom,你会想要使用Maven部署插件的部署文件目标。 mvn deploy将构建项目,但如果您已经获得了jar和pom文件并且没有源代码,那么它将无法工作。

当然您也可以upload the files via the web user interface of Nexus或使用the REST api.您可以找到一些REST api示例with curl on github