前提maven环境建好。
把本地的两个文件:
C:\Users\AAAA\Desktop\gansutmp\ojdbc\ojdbc8-21.1.0.0.jar
C:\Users\AAAA\Desktop\gansutmp\ojdbc\orai18n-21.1.0.0.jar
放入到本地maven仓库
java工程中POM中依赖:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>21.0.0</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>orai18n</artifactId>
<version>21.0.0</version>
</dependency>
在cmd中执行下面两条命令后就完成了:
mvn install:install-file -Dfile=C:\Users\AAAA\Desktop\gansutmp\ojdbc\ojdbc8-21.1.0.0.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=21.0.0 -Dpackaging=jar
mvn install:install-file -Dfile=C:\Users\AAAA\Desktop\gansutmp\ojdbc\orai18n-21.1.0.0.jar -DgroupId=com.oracle -DartifactId=orai18n -Dversion=21.0.0 -Dpackaging=jar
mvn命令参数与pom关系:
-Dfile:包的本地真实地址
-DgroupId:pom.xml中groupId
-DartifactId:pom.xml中artifactId
-Dversion:pom.xml中0.0.1-SNAPSHOT
-Dpackaging:jar或war,包的后缀名
-Dclassifier:兄弟包的别名,也就是-Dversion值后面的字符