在没有Maven的情况下将工件上传到Nexus [英] Upload artifacts to Nexus, without Maven

查看:120
本文介绍了在没有Maven的情况下将工件上传到Nexus的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非Java项目,该项目会生成版本化的构建工件,因此我希望将其上载到Nexus存储库.因为该项目不是Java,所以它不使用Maven进行构建.而且我不想引入Maven/POM文件只是为了使文件进入Nexus.

I have a non-Java project that produces a versioned build artifact, and I want to upload this to a Nexus repository. Because the project isn't Java, it doesn't use Maven for builds. And I'd rather not introduce Maven/POM files just to get files into Nexus.

博客上指向Nexus REST API的链接都以登录墙结尾,没有我可以看到的创建用户"链接.

The links on blogs to the Nexus REST API all end up at a sign-in wall, with no "create user" link that I can see.

那么,在没有Maven的情况下将构建工件上传到Nexus存储库的最佳(或任何合理的)方法是什么? "bash + curl"会很棒,甚至是Python脚本.

So, what's the best (or any reasonable) way to upload build artifacts to a Nexus repository without Maven? "bash + curl" would be great, or even a Python script.

推荐答案

您是否考虑过使用Maven命令行上传文件?

Have you considering using the Maven command-line to upload files?

mvn deploy:deploy-file \
    -Durl=$REPO_URL \
    -DrepositoryId=$REPO_ID \
    -DgroupId=org.myorg \
    -DartifactId=myproj \
    -Dversion=1.2.3  \
    -Dpackaging=zip \
    -Dfile=myproj.zip

这将自动为工件生成Maven POM.

This will automatically generate the Maven POM for the artifact.

以下Sonatype文章指出,"deploy-file" maven插件是最简单的解决方案,但它也提供了一些使用curl的示例:

The following Sonatype article states that the "deploy-file" maven plugin is the easiest solution, but it also provides some examples using curl:

https://support.sonatype.com/entries/22189106-我如何以编程方式将人工制品上载到Nexus-

这篇关于在没有Maven的情况下将工件上传到Nexus的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆