mvn install:install-file -Dfile=path/to/hello-world-1.0.jar -DgroupId=com.thoughtworks.davenkin -DartifactId=hello-world -Dversion=1.0 -Dpackaging=jar
语法说明:
mvn install:install-file
-Dfile=
-DgroupId=
-DartifactId=
-Dversion=
-Dpackaging=
-DgeneratePom=true
通过上面的方式先把jar包install到本地库,即.m2目录下,然后在项目中引用即可。
参看:http://www.cnblogs.com/CloudTeng/archive/2012/02/15/2353103.html
还有一种方式:
groupId ...
artifactId ...
version ...
参看:http://stackoverflow.com/questions/4491199/build-maven-project-with-propriatery-libraries-included/4491343#4491343