首页 > 解决方案 > 使用 gradle 从 Nexus 获取 oracle JDBC jar

问题描述

我看到了这个问题,但似乎没有任何帮助。我会尽力使答案更好,并希望能给出解决方案。

在我的build.gradle下面dependencies我有:

compile files('oracle/ojdbc7-12.1.0.2.jar')我手动将jar放在目录中。

我现在正在做的是试图将它从 nuxus 中拉出来。

我是本地人gradle.properties,我添加了我的用户名和密码,但它会提取所有依赖项,并且无法从 nexus 获取它们并且失败。我只想jar用 gradle build 拉一个(jbdc)。

错误在这里:

> Configure project :api 
init.gradle/NexusRepositoryPlugin:    MavenRepo at https://repo.maven.apache.org/maven2/ removed.
init.gradle/NexusRepositoryPlugin:    __plugin_repository__Gradle Central Plugin Repository kept (not a Maven repository).
init.gradle/NexusRepositoryPlugin:    MavenRepo at https://repo.maven.apache.org/maven2/ removed.
init.gradle/NexusRepositoryPlugin:    BintrayJCenter at https://jcenter.bintray.com/ removed.

* What went wrong:
Could not resolve all dependencies for configuration ':api:detachedConfiguration1'.
> Could not resolve org.springframework.boot:spring-boot-dependencies:2.0.1.RELEASE.
  Required by:
      project :api
   > Could not resolve org.springframework.boot:spring-boot-dependencies:2.0.1.RELEASE.

建议?

标签: gradlenexus

解决方案


我对这个问题的理解表明您正在公共存储库声明替换为仅包含该 JDBC jar 的私有存储库声明。

相反,您应该保留公共存储库声明并添加私有存储库声明。然后 Gradle 将在第一次搜索 JDBC jar 并检索它。


推荐阅读