我目前在我的公司作業,使用 Oracle 資料庫在 Spring Boot 中開發 API,問題是我們使用 liquibase 創建資料庫,當我嘗試使用命令時:
mvn liquibase:update -Dliquibase.url="jdbc:oracle:thin:@..." -Dliquibase.username="xxx" -Dliquibase.password="xxx" -Dinterface-user="xxx" -Dtablespace-tablas="xxx" -Dtablespace-indices="xxx" -Dstorage-tablas="xxx" -Dstorage-indices="xxx"
它回傳給我這個錯誤:
Plugin .url=jdbc:oracle:thin or one of its dependencies could not be resolved: Failure to find .url=jdbc:oracle:jar:thin in https://maven.oracle
.com was cached in the local repository, resolution will not be reattempted until the update interval of maven.oracle.com has elapsed or updates are for
ced -> [Help 1]
我認為這與oracle的依賴關系ojdbc8有關,但我不知道如何使它作業。我知道資料庫的所有憑據和一切都是正確的,因為我可以完全使用它們通過資料庫管理器連接到資料庫。
這是我在 pom.xml 中的依賴項:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>19.3</version>
</dependency>
現在我已經嘗試過這些事情:
- 從 maven repo ( https://mvnrepository.com/artifact/com.oracle.ojdbc/ojdbc8/19.3.0.0 )下載依賴項并使用以下命令在本地安裝它:
mvn install:install-file -Dfile=./ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=19.3 -Dpackaging=jar。
這應該是在本地安裝了依賴項,但仍然不起作用。
- 按照這個oracle指南(https://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9016)將oracle服務器添加到maven配置中的依賴庫
通過第二個更改,我設法得到一個不同的錯誤:
Plugin .url=jdbc:oracle:thin or one of its dependencies could not be resolved: Could not find artifact .url=jdbc:oracle:jar:thin in maven.oracle
.com (https://maven.oracle.com) -> [Help 1]
你能幫我找出我做錯了什么或我可能遺漏了什么嗎?謝謝!
uj5u.com熱心網友回復:
您需要使用以下 GAV 從中央 maven 下載 JDBC 驅動程式。有關更多詳細資訊,請參閱Maven 指南
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>19.3.0.0</version>
</dependency>
uj5u.com熱心網友回復:
最后,主要問題是我使用的是 IntelliJ 的嵌入式控制臺,但它沒有那樣作業,我切換到 cmd 并且它作業了......
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/389873.html
