http://yeelor.iteye.com/blog/1646928
For jar packs that are not in the official warehouse, MAVEN imports jar packages with the following command from the local warehouse
CMD code MVN install:install-file-dgroupid= Package name-dartifactid= Project name-dversion= version number-dpackaging=jar-dfile=jar file path
Take Paoding-analysis.jar as an example:
1, put the Paoding-analysis.jar file in the "D:\lib" directory
2, in a Pom.xml file in the engineering directory to execute the order:
CMD code MVN install:install-file-dfile=d:\lib\paoding-analysis.jar-dgroupid=net.paoding-dartifactid= Paoding-analysis-dversion=3-dpackaging=jar-dgeneratepom=true-dcreatechecksum=true
This allows Maven to import the Paoding-analysis.jar package to the local repository successfully.
D:\Documents and Settings\administrator\.m2\repository\net\paoding\paoding-analysis\3\paoding-analysis-3.jar
3.pom.xml File configuration:
XML code <dependency> <groupid>net.paoding</ groupid> <artifactId>paoding-analysis</artifactId> <version>3</version> <type> jar</type> </dependency>
4. Example:
CMD code MVN install:install-file-dfile=f:\java\maven-workspace\mylucenetest\lib\ Paoding-analysis-3.jar-dgroupid=net.paoding-dartifactid=paoding-analysis-dversion=3-dpackaging=jar- Dgeneratepom=true-dcreatechecksum=true MVN install:install-file-dfile=f:\java\maven-workspace\ mylucenetest\lib\cpdetector-1.0.10.jar-dgroupid=info.monitorenter-dartifactid=cpdetector-dversion=1.0.10- Dpackaging=jar-dgeneratepom=true-dcreatechecksum=true mvn install:install-file-dfile=f:\java\ maven-workspace\mylucenetest\lib\chardet-1.1.jar-dgroupid=org.mozilla.intl-dartifactid=chardet-dversion=1.1- dpackaging=jar-dgeneratepom=true-dcreatechecksum=true 5. Example add Ojdbc.jar driver MAVEN code mvn install:install-file -dfile=i:\lib\ojdbc6.jar -dgroupid=com.oracle - dartifactid=ojdbc6 -dversion=11.1.0.6.0 -dpackaging=jar -dgeneratepom=true - dcreatechecksum=true