maven加載ojdbc14報錯

問題復現步驟: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>到此成功解決!
相關文章
相關標籤/搜索