Spring Boot Maven project will not download the latest Oracle ojdbc8 .jar file when I add the newest <dependency>

huangapple go评论83阅读模式
英文:

Spring Boot Maven project will not download the latest Oracle ojdbc8 .jar file when I add the newest <dependency>

问题

我无法将我的 Oracle ojdbc 驱动程序更新到最新版本,用于我的 Oracle 数据库。

我正在将我的 pom.xml 文件更新为我 19c 版本的 Oracle 数据库的最新版本,但在保存后,它不会将最新的 .jar 文件添加到我的 Maven 依赖项中。它会在 c:-temp-com-oracle 文件夹结构中创建文件夹,但没有 .jar 文件。

我对此有些陌生,不太确定我错过了什么。我的理解是,Spring Boot 应该根据 pom 文件自动下载正确的依赖项。

谢谢您的任何帮助。

信息

Java 版本 1.8
Oracle 19c 数据库

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.3.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc8</artifactId>
    <version>19.3.0.0</version>
</dependency>

之前的版本(没有任何问题的版本)

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.3</version>
</dependency>
英文:

I am unable to update my Oracle ojdbc driver to the newest version for my oracle database.

I am updating my pom.xml file to the newest version for my 19c oracle database and after its saved it does not add the newest .jar file to my maven dependencies. It creates the folder in the c:-temp-com-oracle folder structure but no .jar file

I am somewhat new to this and not sure what I am missing. My understanding is that spring boot should automatically download the correct dependencies according to the pom file.

Thank you for any assistance.

INFO

Java Version 1.8
Oracle 19c DB

&lt;parent&gt;
	&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
	&lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
	&lt;version&gt;2.0.3.RELEASE&lt;/version&gt;
	&lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
&lt;/parent&gt;

&lt;dependency&gt;
      	&lt;groupId&gt;com.oracle&lt;/groupId&gt;
		&lt;artifactId&gt;ojdbc8&lt;/artifactId&gt;
		&lt;version&gt;19.3.0.0&lt;/version&gt;
&lt;/dependency&gt;

Previous Version (that worked with no issues)

&lt;dependency&gt;
      	&lt;groupId&gt;com.oracle&lt;/groupId&gt;
      	&lt;artifactId&gt;ojdbc6&lt;/artifactId&gt;
      	&lt;version&gt;11.2.0.3&lt;/version&gt;	
&lt;/dependency&gt;

答案1

得分: 4

你的组ID有误,请使用正确的Maven Central依赖:https://search.maven.org/artifact/com.oracle.ojdbc/ojdbc8/19.3.0.0/jar

<dependency>
  <groupId>com.oracle.ojdbc</groupId>
  <artifactId>ojdbc8</artifactId>
  <version>19.3.0.0</version>
</dependency>

需要注意的是,从2019年9月开始,Oracle的ojdbc驱动现在在Maven Central仓库中发布:

https://blogs.oracle.com/dev2dev/get-oracle-jdbc-drivers-and-ucp-from-oracle-maven-repository-without-ides

https://medium.com/oracledevs/oracle-jdbc-drivers-on-maven-central-64fcf724d8b

英文:

You have a wrong group id, correct dependency on maven central: https://search.maven.org/artifact/com.oracle.ojdbc/ojdbc8/19.3.0.0/jar

&lt;dependency&gt;
  &lt;groupId&gt;com.oracle.ojdbc&lt;/groupId&gt;
  &lt;artifactId&gt;ojdbc8&lt;/artifactId&gt;
  &lt;version&gt;19.3.0.0&lt;/version&gt;
&lt;/dependency&gt;

Note that since september 2019, ojdbc drivers are now published on maven central repo by Oracle:

https://blogs.oracle.com/dev2dev/get-oracle-jdbc-drivers-and-ucp-from-oracle-maven-repository-without-ides

https://medium.com/oracledevs/oracle-jdbc-drivers-on-maven-central-64fcf724d8b

答案2

得分: 0

这实际上与我在远程工作时的代理设置有关。在我的settings.xml正确更新之后,我就没有任何问题了。我也更新了groupId,谢谢。

英文:

It actually had to do with my Proxy Settings while working remotely. After my settings.xml was updated correctly I had no issues. I did update the groupId as well, thanks

huangapple
  • 本文由 发表于 2020年4月8日 09:02:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/61091769.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定