码迷,mamicode.com
首页 > 其他好文 > 详细

Maven 安装依赖包

时间:2019-11-26 13:06:57      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:pid   build   group   ike   get   this   central   exist   plugin   

Guide to installing 3rd party JARs Although rarely, but sometimes you will have 3rd party JARs that you need to put in your local repository for use in your builds, since they don‘t exist in any public repository like Maven Central. The JARs must be placed in the local repository in the correct place in order for it to be correctly picked up by Apache Maven. To make this easier, and less error prone, we have provide a goal in the maven-install-plugin which should make this relatively painless. To install a JAR in the local repository use the following command:

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

If there‘s a pom-file as well, you can install it with the following command:

mvn install:install-file -Dfile=<path-to-file> -DpomFile=<path-to-pomfile>

With version 2.5 of the maven-install-plugin it gets even better. If the JAR was built by Apache Maven, it‘ll contain a pom.xml in a subfolder of the META-INF directory, which will be read by default. In that case, all you need to do is:

mvn install:install-file -Dfile=<path-to-file>

Maven 安装依赖包

标签:pid   build   group   ike   get   this   central   exist   plugin   

原文地址:https://www.cnblogs.com/fsckzy/p/11934638.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!