mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging=jar -Dfile=D:ojdbc14-10.2.0.4.0.jar
安装完毕后,就在 pom.xml 中声明坐标
<dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.4.0</version> </dependency>
示例:
D:>mvn install:install-file -Dfile=c:kaptcha-2.3.jar -DgroupId=com.google.code -DartifactId=kaptcha -Dversion=2.3 -Dpackaging=jar [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'install'. [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Default Project [INFO] task-segment: [install:install-file] (aggregator-style) [INFO] ------------------------------------------------------------------------ [INFO] [install:install-file] [INFO] Installing c:kaptcha-2.3.jar to D:maven_repocomgooglecodekaptcha2.3kaptcha-2.3.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: < 1 second [INFO] Finished at: Tue May 12 13:41:42 SGT 2014 [INFO] Final Memory: 3M/6M [INFO] ------------------------------------------------------------------------
参考:https://www.yiibai.com/maven/include-library-manully-into-maven-local-repository.html#article-start