官方Maven Repository裏已經再也不支持較新的ojdbc驅動,只能從官網上下載相關jar包,而後手動添加到本地maven數據倉庫中。若是是Mysql驅動同理。 ojdbc<version>.jar下載地址:http://www.oracle.com/technetwork/database/features/jdbc/index-091264.htmlhtml
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"
參數說明:sql
pom.xml文件添加依賴示例:apache
<dependencies> <!-- oracle jdbc driver --> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.1.0.7.0</version> </dependency> </dependencies>
D:\mvnrepo.m2\settings.xml內容oracle
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 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"> <localRepository>D:\mvnrepo\.m2\repository</localRepository> </settings>