使用maven添加仓库中没有的jar包
进入命令窗口
如添加ojdbc.jar到本地仓库
E:\download>mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -D
version=6 -Dpackaging=jar -Dfile=ojdbc6.jar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom
---
[INFO] Installing E:\download\ojdbc6.jar to F:\repository\com\oracle\ojdbc6\6\oj
dbc6-6.jar
[INFO] Installing C:\Users\ADMINI~1\AppData\Local\Temp\mvninstall434679515921336
8725.pom to F:\repository\com\oracle\ojdbc6\6\ojdbc6-6.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.132 s
[INFO] Finished at: 2015-08-02T13:53:04+08:00
[INFO] Final Memory: 6M/122M
[INFO] ------------------------------------------------------------------------
E:\download>
添加到pom.xml文件中的依赖为
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>6</version>
</dependency>