简体   繁体   中英

Installing 3rd party JARs to Jenkins .m2 repository

I am Trying to add a third party jar to jenkis .m2 repository

This is the command i found to add it to the repository from command line

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
    -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

i have a linux machine where jenkins run by its own user. it has a .m2 repository in the home directory. when i tried the above command it gives error saying that, The program 'mvn' can be found in the following packages:* maven * maven2 . so jenkins can build with out a maven installed?, if so how it is done?. how can i add the jar to .m2 repository without installing maven ?

i read that maven need a setting.xml file in its .m2 folder, but i cant find any for jenkins.

You can also use the maven binary from the jenkin's maven-plugin . Use find / -type f -name mvn to find out, where the jenkins maven plugin is installed to and call mvn from there.

You can then change mvn install:install-file ... to <pathFromFind>/mvn install:install-file ... or add this path to your PATH variable.

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