maven 向本地私库导入jar

1 mvn install:install-file   
2 -DgroupId=<your_group_name>    
3 -DartifactId=<your_artifact_name>    
4 -Dversion=<snapshot>    
5 -Dfile=<path_to_your_jar_file>    
6 -Dpackaging=jar   
7 -DgeneratePom=true

 

若是提供的jar有依赖其他jar,那还得将依赖关系加上, 即指定 pom 文件,不然依赖就会丢失。 方法是:

mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=path-to-your-artifact-jar -DpomFile=path-to-pom

 

 

参考:

1、http://my.oschina.net/jiyayun/blog/147997

2、 http://maven.apache.org/plugins/maven-install-plugin/examples/custom-pom-installation.html

 

posted @ 2015-06-15 15:24  xunux  阅读(1817)  评论(0编辑  收藏  举报