maven添加非官方jar包到本地库
Sometimes, you project will have dependency on a jar which isnot in official mavenrepository, and maybe it is propriety jar file which will never be part ofmavenrepository . Inthis case, you have to put it to your local repository yourself to solve the dependency.
There is a install plug in to do this job, which is somethinglike
?For example, you want to install the danga’s memcached clientplugin, you can do:
mvn install:install-file -DgroupId=com.danga -DartifactId=memcached -Dversion=2.0.1 -Dfile=java_memcached-release_2.0.1.jar -Dpackaging=jar \-DgeneratePom=true
This will add the memcache jar into your local Maven2repository undergroupId com.danga and artifactId memcached, you can then edit yourpom.xml adding this dependency.
However, the maven eclipsecan not recognize it since it always search from publicrepository
?
?
1. 安装到本地库:
??? 例如安装jsr173.jar
??? mvn install:install-file -DgroupId=com.bea.xml -DartifactId=jsr173-ri -Dversion=1.0 -Dpackaging=jar -Dfile=[path to file]
?
2. 安装到私服
??? mvn deploy:deploy-file -DgroupId=com.bea.xml -DartifactId=jsr173-ri -Dversion=1.0 -Dpackaging=jar -Dfile=[path to file] -Durl=[url] -DrepositoryId=[id]