简体   繁体   中英

How to install library to external maven repository

in your company we are using archiva as our maven repository. How I can install there some library which is not mavenized remotely ? In my local repository I can do something like this:

mvn install:install-file -D groupId=cz.i -D artifactId=sql-processor \
                         -D version=1.0 -D packaging=jar \
                         -D file=~/programy/cro/lib/sql-processor.jar

When I want to add some maven project to our archiva, I can run this command: mvn:deploy . But I have no idea how to install just library there

You're closer than you think - just replace install:install-file with deploy:deploy-file and add a bit of sugar, as can be read here :

mvn deploy:deploy-file -DgroupId=cz.i \
  -DartifactId=sql-processor \
  -Dversion=1.0 \
  -Dpackaging=jar \
  -Dfile=~/programy/cro/lib/sql-processor.jar \
  -DrepositoryId=<id-to-archiva-map-on-server-section-of-settings.xml> \
  -Durl=<your-archiva-URL>

As you - correctly - state, this should only be used for "non-mavenized" external artifacts, otherwise mvn deploy is the way to go.

Cheers,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM