官方Maven Repository里已经不再支持较新的ojdbc驱动,只能从官网上下载相关jar包,然后手动添加到本地maven数据仓库中。如果是Mysql驱动同理。 ojdbc
mvn -s D:\mvnrepo\.m2\settings.xml install:install-file "-DgroupId=com.oracle" "-DartifactId=ojdbc6" "-Dversion=11.1.0.7.0" "-Dpackaging=jar" "-Dfile=ojdbc6-11.1.0.7.0.jar"
参数说明:
install:install-file指定安装文件
-s指定的是本地maven库的配置文件,并且指定了本地maven库的地址。不使用这个参数默认安装在家目录的.m2目录中。
-packaging指定类型
-Dfile指定的是下载的jar包.
-DgroupId、-DartifactId、-Dversion指定的是pom文件中依赖参数
pom.xml文件添加依赖示例:
com.oracle
ojdbc6
11.1.0.7.0
D:\mvnrepo.m2\settings.xml内容
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
D:\mvnrepo\.m2\repository