简体   繁体   English

Gradle 在 Z6B7B655DD22FAA3F1067Z07C512493AA8 中找到错误的 maven 存储库 url

[英]Gradle find wrong maven repository url in eclipse

this is my build.gradle这是我的build.gradle

repositories {
    mavenCentral()
    maven{url 'http://example.com/repository/maven-public/'}
}

dependencies {
    compile group: 'com.example', name: 'example-commlib', version: '1.0'
}

and the link http://example.com/repository/maven-public/ is build from Nexus Repository Manager which can accessable.并且链接http://example.com/repository/maven-public/是从可以访问的 Nexus Repository Manager 构建的。

and when I click Refresh Gradle Project in eclipse.当我单击 eclipse 中的Refresh Gradle Project时。 I can see the link is point to我可以看到链接指向

https://repo.maven.apache.org/..../example-commlib-1.0.pom

I think the right url is我认为正确的 url 是

http://example.com/repository/maven-public/.../example-commlib-1.0.pom

I've check the gradle setting and maven setting in eclipse.我检查了 eclipse 中的 gradle 设置和 maven 设置。 It seems fine.看起来不错。

So what's the problem?所以有什么问题?

Do you have other dependencies on this project?你对这个项目还有其他依赖吗? It is possible that the "pom.xml" file of one of the packages you are pulling references example-commlib as a dependency and has the Apache Maven URL hardcoded, and resolves the URL beforehand. It is possible that the "pom.xml" file of one of the packages you are pulling references example-commlib as a dependency and has the Apache Maven URL hardcoded, and resolves the URL beforehand. You can use gradle dependencies to show the dependency tree and find which version is affected.您可以使用gradle dependencies来显示依赖关系树并查找受影响的版本。 The answers in this post have suggestions on how to force a specific dependency as well: How can I force Gradle to set the same version for two dependencies?这篇文章中的答案也对如何强制特定依赖项提出了建议: 如何强制 Gradle 为两个依赖项设置相同的版本?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM