Ant调用子项目父项目ivy.xml覆盖子项目ivy.xml

发布于 2024-08-31 00:28:13 字数 143 浏览 2 评论 0原文

我们有一个父项目和一个使用 ant 和 ivy 构建的 java 子项目。子项目需要能够独立构建。

当父项目调用子项目时antfile命令 - 父项目的ivy.xml覆盖子项目的ivy.xml

有谁知道如何让子项目使用自己的ivy.xml?

We've got a parent project and a child project java builds using ant and ivy. 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

Does anyone know how to keep the child project using its own ivy.xml?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无法言说的痛 2024-09-07 00:28:13

我猜测 ivy 正在从默认位置获取 ivy 文件,该位置与构建文件位于同一目录中。

一种方法是显式设置 ivy 文件的位置:

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

更好的方法是找出子构建的基本目录位置。你如何调用子项目?您使用的是 subant 还是 ant Ant 任务?

如果是后者,请确保使用 dir 属性:

<ant dir="subproject"/>

这将为子项目指定基本目录。

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?

If it is the latter make sure to use the dir attribute:

<ant dir="subproject"/>

This will specify the base dir for the child project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文