简体   繁体   English

蚂蚁调用子项目父项目ivy.xml覆盖子项目ivy.xml

[英]Ant calling child project parent project ivy.xml overriding child project ivy.xml

We've got a parent project and a child project java builds using ant and ivy. 我们有一个父项目,一个子项目是使用ant和ivy构建的Java。 The child project needs to be able to build independently. 子项目需要能够独立构建。

When the parent project calls the child project the antfile command - the parent project's ivy.xml overrides the child project's ivy.xml 当父项目调用子项目的antfile命令时-父项目的ivy.xml覆盖子项目的ivy.xml

Does anyone know how to keep the child project using its own ivy.xml? 有谁知道如何使用自己的ivy.xml保留子项目?

I'm guessing that ivy is picking up the ivy file from the default location, which would be in the same directory as the build file. 我猜测常春藤正在从默认位置中提取常春藤文件,该默认位置与构建文件位于同一目录中。

One approach would be to explicitly set the ivy file's location: 一种方法是显式设置常春藤文件的位置:

<ivy:resolve file="path/to/ivy.xml"/>

A better approach would be to figure out the base directory location for your child build. 更好的方法是找出您的孩子构建的基本目录位置。 How are you invoking child project? 您如何调用子项目? Are you using the subant or the ant Ant task? 您正在使用subant还是ant Ant任务?

If it is the latter make sure to use the dir attribute: 如果是后者,请确保使用dir属性:

<ant dir="subproject"/>

This will specify the base dir for the child project. 这将指定子项目的基本目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM