我在这里从他们的github下载了gradle插件测试项目:
https://github.com/gradle/gradle/tree/master/subprojects/docs/src/samples/customPlugin
我还将gradle更新为最新(4.7
)。
当我对gradle build
项目进行consumer
时,出现以下构建错误:
FAILURE: Build failed with an exception.
配置根项目“消费者”时发生问题。
Could not resolve all artifacts for configuration ':classpath'. Could not find org.gradle:customPlugin:1.0-SNAPSHOT. Searched in the following locations: file:/C:/Code/gradle/subprojects/docs/src/samples/customPlugin/repo/org/gradle/customPlugin/1.0-SNAPSHOT/maven- metadata.xml file:/C:/Code/gradle/subprojects/docs/src/samples/customPlugin/repo/org/gradle/customPlugin/1.0-SNAPSHOT/custom Plugin-1.0-SNAPSHOT.pom file:/C:/Code/gradle/subprojects/docs/src/samples/customPlugin/repo/org/gradle/customPlugin/1.0-SNAPSHOT/custom Plugin-1.0-SNAPSHOT.jar Required by: project :
这是什么问题?我想我对gradle插件还不够了解。是否需要以某种方式构建插件?我没有
1.0-SNAPSHOT
pat或任何类似的东西,似乎在找它。
最佳答案
Does the plugin need to be built somehow ?
是的,首先,否则
consumer
项目将找不到它。在
plugin
项目中,只需运行gradle uploadArchive
然后在
gradle build
项目中重试consumer
关于gradle - Gradle插件测试项目构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49972679/