我有一个工作项目,它依赖由对等组件生成的maven工件,如下所示:
repositories {
ivy {
url "../cnf/local"
}
}
configurations {
ejbTools
}
dependencies {
ejbTools 'test:com.ibm.ws.ejbcontainer.fat_tools:1.+'
}依赖项test:com.ibm.ws.ejbcontainer.fat_tools:1.+无法用Gradle 6.0解析,出现以下错误:
> Task :com.ibm.ws.ejbcontainer.async_fat:addEJBTools FAILED
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/aguibert/dev/git/open-liberty/dev/com.ibm.ws.ejbcontainer.async_fat/build.gradle' line: 32
* What went wrong:
Execution failed for task ':com.ibm.ws.ejbcontainer.async_fat:addEJBTools'.
> Could not resolve all files for configuration ':com.ibm.ws.ejbcontainer.async_fat:ejbTools'.
> Could not find any matches for test:com.ibm.ws.ejbcontainer.fat_tools:1.+ as no versions of test:com.ibm.ws.ejbcontainer.fat_tools are available.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/test/com.ibm.ws.ejbcontainer.fat_tools/maven-metadata.xml
- http://public.dhe.ibm.com/ibmdl/export/pub/software/olrepo/test/com.ibm.ws.ejbcontainer.fat_tools/maven-metadata.xml
- file:/Users/aguibert/dev/git/open-liberty/dev/cnf/local/test/com.ibm.ws.ejbcontainer.fat_tools/
- file:/Users/aguibert/dev/git/open-liberty/dev/cnf/local/test/com.ibm.ws.ejbcontainer.fat_tools/1.0.33.201909241016/ivy-1.0.33.201909241016.xml
Required by:
project :com.ibm.ws.ejbcontainer.async_fat上下文
目前,我的项目正在使用Gradle 5.5,可以用Java 8、11或12构建。我也试图让它与Java 13一起工作,所以我尝试升级到Gradle 6.0。
现在看来,随着通配符依赖关系在Gradle (例如com.foo:bar:1.+)中的工作方式,出现了一种普遍的行为变化。
发布于 2019-09-25 15:52:53
根据这个等级问题的说法,在Gradle 6.0中,行为发生了急剧的变化。在此之前,Gradle会自动检查工件元数据(例如maven-metadata.xml),但是为了提高性能,Gradle 6.0似乎不再默认这样做了。
这一问题有两种可能的解决办法:
1.+这样的通配符版本(这是最好的实践,海事组织)repositories.[maven|ivy].metadataSources配置。在第5.X级中,缺省值是:
存储库{ maven { url "http://repo.mycompany.com/repo“metadataSources { mavenPom() mavenPom()}} ivy { url "http://repo.mycompany.com/repo”metadataSources { ivyDescriptor()工件()}
但在6.0级中,它们现在是:
知识库{ maven { url "http://repo.mycompany.com/repo“metadataSources { mavenPom() }} ivy { url "http://repo.mycompany.com/repo”metadataSources { ivyDescriptor() }
因此,要恢复到以前的行为,请将artifact()配置添加到repositores.[maven|ivy].metadataSources配置块中。https://stackoverflow.com/questions/58102283
复制相似问题