我在一家有严格政策禁止使用未过滤的外部库的大公司工作。我们必须从公司指定的代码仓库中拉取所有东西,而不是从裸露的互联网上,包括gradle.org。
使用gradle的原始apply插件语法,结合buildscript块,我可以将(经过认可的)插件添加到我们的代码仓库中并在构建中使用它们。换句话说:
buildscript {
repositories {
maven { url "https://privaterepo.myemployer.com" }
}
dependencies {
// various dependencies
classpath "org.something:some-plugin:1.0"
...
}
apply plugin: "someplugin"
相反,我希望能够使用新的插件DSL,即:
plugins {
id 'org.something.some-plugin' version '1.0'
}
我意识到私有存储库的网址需要在某处定义。
新插件语法总是前往gradle.org,似乎没有提供替代下载网址的方法。有人知道吗?
我已经仔细查阅了文档和互联网,但找不到答案。如果答案显而易见,请原谅。
非常感谢!