我想知道是否有排除依赖项(而不是传递依赖项)内的特定文件被下载的问题。Gradle排除依赖关系中的特定文件
我正在从Ant + Ivy切换到Gradle构建,这是在Ivy之前完成的。我问,因为我有一个单独的依赖项,其中包含Artifactory中许多已编译的wsdl jar,我们正在下拉菜单,但我不想下载依赖项中的所有jar。
在常春藤它是设置这样的:
这6个构件发布到artifactory的一个目录回购/ dep.location /示例/ 7.3 /罐。
<publications>
<artifact name="foo-1-0" type="jar" />
<artifact name="foo-1-0-async" type="jar" />
<artifact name="foo-1-0-xml" type="jar" />
<artifact name="bar-1-0" type="jar" />
<artifact name="bar-1-0-async" type="jar" />
<artifact name="bar-1-0-xml" type="jar" />
</publications>
这就是我如何检索六个工件中的两个。
<dependency org="dep.location" name="example" rev="7.3"
conf="compile,runtime">
<include name="foo-1-0-async"/>
<include name="foo-1-0-xml"/>
</dependency>
目前,如果我试图做摇篮类似的东西排除被忽略,所有六个文物被下载。
compile (group:"dep.location", name:"example", version:"7.3")
{
exclude module:'foo-1-0-xml'
exclude module:'bar-1-0'
exclude module:'bar-1-0-async'
exclude module:'bar-1-0-xml'
}
我正在使用Gradle版本1.8。
你试图排除的东西是工件,而不是模块。在我意识到的Gradle中包含/排除工件的唯一受支持的方式是按类型,这在这里没有帮助。 –
这在gradle中不受支持。但另一种选择是改变你如何发布到artifactory。 为什么不开始在artifactory中发布个别的jar文件? – vkg
好的,谢谢。 – bhumphrey