问题复现步骤:oracle
一、在pom.xml里面添加ojdbc14的依赖,代码以下:dom
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.2</version>
</dependency>
二、执行mvn install报以下错误:maven
[ERROR] Failed to execute goal on project ssm_domain: Could not resolve dependencies for project com.miyoo.ssm:ssm_domain:jar:1.0-SNAPSHOT: Failure to find com.oracle:ojdbc14:jar:5.0.2.RELEASE in http://maven.aliyun.com/nexus/content/reposi
tories/central/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced -> [Help 1]spa
问题分析:xml
由于oracle的ojdbc.jar是收费的,因此maven的中央仓库中没有这个资源,只能经过配置本地库才能加载到项目中去。ci
解决方法:资源
一、首先下载ojdbc14,下面提供的版本是:11.2.0.1.0。cmd
连接:https://pan.baidu.com/s/1iB-0QhZ_imffZ-roZVdzvQ
提取码:ewxxit
二、接着打开命令提示符窗口,可经过快捷键Windows+R,执行cmd命令打开。io
执行以下命令
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=11.2.0.1.0 -Dpackaging=jar -Dfile=D:\软件\it\ojdbc14.jar
-Dfile=ojdbc14.jar文件存放的路径
三、最后在pom.xml文件中写入Maven坐标:
<dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>11.2.0.1.0</version> </dependency>到此成功解决!