将linux二进制文件上传到Maven存储库 [英] Upload linux binary file to maven repository

查看:114
本文介绍了将linux二进制文件上传到Maven存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜索了很多如何将文件上传到Maven的方法,但是我没有成功. 我有一个二进制文件(称为textgenerator),我想将其上传到Maven存储库之一,以便更多人可以使用.

I have searched a lot how I can upload files to maven, but I did not succeed. I have got a binary file (called textgenerator) that I want to upload to one of maven repositories so it will be available to a lot more people.

现在我对此有一些疑问:

Now I have some questions about it:

您能告诉我如何逐步执行此操作(如教程)吗? 我需要回购网址吗?在哪里可以找到一个? 可以只上传一个二进制文件(没有jar文件)吗?

Could you tell me how I need to do this in steps (like a tutorial)? Do I need a repo url? Where can I find one? Is it possible to just upload a single binary (no jar file)?

我希望很快能收到人们的来信.

I hope to hear from people soon.

我已经尝试过了:

mvn deploy:deploy-file \
 -Durl=https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/ \
 -DrepositoryId=com.textgenerator \
 -DgroupId=org.textgenerator \
 -DartifactId=textgenerator \
 -Dversion=1.2.3  \
 -Dpackaging=rar \
 -Dfile=textgenerator.rar       

然后我将二进制文件压缩成一个rar文件,除此之外没有其他内容.但这失败,代码为301

And I zipped the binary into a rar file with nothing else. But this fails with code 301

推荐答案

首先,您使用的命令行是正确的.

Firstly, the command line you are using is correct.

第二,是的,可以在maven存储库中上载任何类型的文件.

Secondly, yes, it is possible to upload any kind of file on maven repositories.

但是您将无法在jboss的公共存储库中上传任何内容.这是由jboss管理的,并且要由他们来安装新的二进制文件(请参阅此处的过程: https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide ).

But you won't be allowed to upload anything on a public repository such as jboss's repository. This is managed by jboss and it is up to them to install new binaries (see the procedure here: https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide ).

如果要与同事共享二进制文件,则必须设置自己的Maven存储库(例如工件(仅需解压缩的zip和要启动的服务)).

If you want to share your binary file with your colleagues, you'll have to setup your own maven repository (such as artifactory (just a zip to decompress and a service to launch)).

此存储库将是您公司的一种代理.所有的Maven库将被下载一次并存储在该服务器上.并且,您将成为该服务器的管理员,因此可以上传二进制文件并与所有朋友共享!

This repository will be a kind of proxy in your company. All the maven libraries will be downloaded once and stored on this server. And as you'll be the administrator of this server, you'll be allowed to upload your binaries and share them with all your friends !

HIH M.

这篇关于将linux二进制文件上传到Maven存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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