问题
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