配置摇篮科特林DSL自定义库工作

问题描述 投票:-1回答:2

我的工作,而不是使用默认的存储库(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

有谁知道我做错了吗?

gradle kotlin
2个回答
0
投票

如果你要配置的插件库为您buildSrc脚本,你需要创建settings.gradle[.kts]目录内的专用buildSrc文件和配置pluginManagement {}块存在。

事实上,buildSrc是一种单独的生成,这是第一次执行时,主生成被评估前/执行。所以,如果你想在pluginManagement {}脚本中使用这些定制版本库,你不能配置在根项目的settings.gradlebuildSrc块。


-1
投票

它看起来就像你在你的企业缓存未命中摇篮插件库Maven仓库。只要确保你有包括https://plugins.gradle.org/m2/。错误恰好表明,它未能找到该插件

摇篮插件通常列在那里和插件依赖从qaz​​xswpoi取

BTW。我们有科特林jcenter今天,也许是有道理的升级

© www.soinside.com 2019 - 2024. All rights reserved.