我的工作,而不是使用默认的存储库(Maven的中央,jCenter,等等)在一个项目中,我们使用的是内部JFrog库。该项目采用科特林DSL的摇篮。
问题是,即使配置pluginManagement
文件中的settings.gradle.kts
块,摇篮仍尝试从摇篮中央插件库下载依赖
// settings.gradle.kts
pluginManagement {
repositories {
maven(url = "https://myinternalrepo.corp/artifactory")
}
}
// other definitions
失败的消息:
Plugin [id: 'org.gradle.kotlin.kotlin-dsl', version: '1.1.3'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:1.1.3')
Searched in the following repositories:
Gradle Central Plugin Repository
有谁知道我做错了吗?
如果你要配置的插件库为您buildSrc
脚本,你需要创建settings.gradle[.kts]
目录内的专用buildSrc
文件和配置pluginManagement {}
块存在。
事实上,buildSrc
是一种单独的生成,这是第一次执行时,主生成被评估前/执行。所以,如果你想在pluginManagement
{}
脚本中使用这些定制版本库,你不能配置在根项目的settings.gradle
的buildSrc
块。
它看起来就像你在你的企业缓存未命中摇篮插件库Maven仓库。只要确保你有包括https://plugins.gradle.org/m2/
。错误恰好表明,它未能找到该插件
摇篮插件通常列在那里和插件依赖从qazxswpoi取
BTW。我们有科特林jcenter
今天,也许是有道理的升级