由於maven倉庫中沒有oracle.jdbc的poi,所以引入
<!-- https://mvnrepository.com/artifact/com.oracle/ojdbc6 -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4.0-atlassian-hosted</version>
<scope>test</scope>
</dependency>
這個是無效,需要將其jar包下載下來,自己添加到本地maven倉庫
下以後,安裝格式:
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version>- Dpackaging=<packaging>
樣例:mvn install:install-file -DgroupId="com.oracle" "-DartifactId=ojdbc6" "-Dversion=12.2.0.4.0" "-Dpackaging=jar" " -Dfile=D:\program\apache-maven-3.5.3\localRepository\11.2.0.4.0-atlassian-hosted.jar"
Dfile:你本地jar包所在的路徑。
安裝完畢,項目中引入
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>12.2.0.4.0</version>
</dependency>
即可!!