Upload linux binary file to maven repository

二次信任 提交于 2019-12-11 03:58:20

问题


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:

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.

I have tried this:

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       

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


回答1:


Firstly, the command line you are using is correct.

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

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 ).

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)).

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.



来源:https://stackoverflow.com/questions/11612768/upload-linux-binary-file-to-maven-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!