有没有办法可以使用 Maven 存储库向 Ant 添加依赖项? [英] Is there a way I can use Maven repositories to add dependencies to Ant?

查看:30
本文介绍了有没有办法可以使用 Maven 存储库向 Ant 添加依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人见过将 Maven 依赖项添加到 Ant 的技术.我原以为 Ivy 是用来做这个的,但后来我意识到它只是一个 Ant 风格的依赖管理工具.

I was wondering if anybody has seen a technique for adding Maven dependencies to Ant. I thought that Ivy was meant to do this but then I realized that it is only an Ant-style tool for dependency management.

在我看来,如果有人扩展 Ant 以能够引用 Maven 依赖项(也许仅适用于开源库),Ant 可以搭载至少 Maven 的一项重要功能,而无需重新发明轮子.

It seems to me that if somebody extended Ant to be able to reference Maven dependencies (perhaps only for open source libraries) Ant could piggyback at least one great feature of Maven without having to re-invent the wheel.

有什么想法吗?

推荐答案

Maven 有一组 Maven ant 任务,可以下载并放置在您的 Ant lib 目录中.之后,您可以在 Ant 中声明一个由 POM 中的依赖项定义的类路径.这是您可以在 build.xml 中声明的示例.

The Maven has a set of Maven ant tasks that can downloaded and placed in your Ant lib directory. After that, you can declare a classpath in Ant that is defined by the dependencies in your POM. This is an example of what you can declare in your build.xml.

<artifact:dependencies filesetId="deps.fileset" type="jar">
  <pom file="mypom.xml"/>
</artifact:dependencies>

更多细节可以在这里这里.

这篇关于有没有办法可以使用 Maven 存储库向 Ant 添加依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆