问题复现步骤:

1、在pom.xml里面添加ojdbc14的依赖,代码如下:

<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.2</version>
</dependency>

2、执行mvn install报如下错误:

[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]

 

问题分析:

因为oracle的ojdbc.jar是收费的,所以maven的中央仓库中没有这个资源,只能通过配置本地库才能加载到项目中去。

 

解决方法:

1、首先下载ojdbc14,下面提供的版本是:11.2.0.1.0。

链接:https://pan.baidu.com/s/1iB-0QhZ_imffZ-roZVdzvQ
提取码:ewxx

2、接着打开命令提示符窗口,可通过快捷键Windows+R,执行cmd命令打开。

执行如下命令

mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=11.2.0.1.0 -Dpackaging=jar -Dfile=D:软件itojdbc14.jar

-Dfile=ojdbc14.jar
文件存放的路径

3、最后在pom.xml文件中写入Maven坐标:

<dependency>
   <groupId>com.oracle</groupId>
   <artifactId>ojdbc14</artifactId>
   <version>11.2.0.1.0</version>
</dependency>

到此成功解决!
 
内容来源于网络如有侵权请私信删除

文章来源: 博客园

原文链接: https://www.cnblogs.com/qing-wen/p/12259037.html

你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!