Gradle 无法解析 org.springframework.vault:spring-vault-core
Gradle could not resolve org.springframework.vault:spring-vault-core
我有一个项目采用 Spring Vault 来获取凭证。项目依赖如下,之后会自动生成build.gradle
文件
当我构建项目时出现错误
Could not resolve
org.springframework.vault:spring-vault-core:2.2.2.RELEASE.
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
我已经通过转到 Project Structures 检查了库并得到了奇怪的东西
我这里说的奇怪的是jar文件的路径。应该是这样的
%GRADLE_HOME%\caches\modules-2\files-2.1\org.springframework.cloud\spring-cloud-vault-config.2.3.RELEASEfd5a06deb01db77eb3e9b8e723ccc1e0790c420
如何在 IntelliJ 中解决这个问题?
当您在 gradle
中收到有关无法解析依赖项的错误时,您需要检查几件事。
- 代理设置(应该在
gradle.properties
里面)
- 创建目录的权限(特别是在
%GRADLE_HOME%\caches\modules-2\files-2.1
中)
关于代理设置的问题,只需在gradle.properties
中为以下字段设置值
systemProp.http.proxyHost=
systemProp.http.proxyPort=
systemProp.http.nonProxyHosts=
systemProp.https.proxyHost=
systemProp.https.proxyPort=
systemProp.https.nonProxyHosts=
关于权限的问题,尝试创建依赖名称不能解析的目录,例如org.springframework.vault
at %GRADLE_HOME%\caches\modules-2\files-2.1
。如果您的权限被拒绝或根本无法创建,请联系您的 IT 支持!
我有一个项目采用 Spring Vault 来获取凭证。项目依赖如下,之后会自动生成build.gradle
文件
当我构建项目时出现错误
Could not resolve org.springframework.vault:spring-vault-core:2.2.2.RELEASE.
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
我已经通过转到 Project Structures 检查了库并得到了奇怪的东西
我这里说的奇怪的是jar文件的路径。应该是这样的
%GRADLE_HOME%\caches\modules-2\files-2.1\org.springframework.cloud\spring-cloud-vault-config.2.3.RELEASEfd5a06deb01db77eb3e9b8e723ccc1e0790c420
如何在 IntelliJ 中解决这个问题?
当您在 gradle
中收到有关无法解析依赖项的错误时,您需要检查几件事。
- 代理设置(应该在
gradle.properties
里面) - 创建目录的权限(特别是在
%GRADLE_HOME%\caches\modules-2\files-2.1
中)
关于代理设置的问题,只需在gradle.properties
中为以下字段设置值systemProp.http.proxyHost=
systemProp.http.proxyPort=
systemProp.http.nonProxyHosts=
systemProp.https.proxyHost=
systemProp.https.proxyPort=
systemProp.https.nonProxyHosts=
关于权限的问题,尝试创建依赖名称不能解析的目录,例如org.springframework.vault
at %GRADLE_HOME%\caches\modules-2\files-2.1
。如果您的权限被拒绝或根本无法创建,请联系您的 IT 支持!