Ant和使用maven依赖项和设置文件

时间:2015-03-13 11:44:51

标签: ant maven-ant-tasks

我们有一个使用ANT进行构建的遗留项目。它使用maven ant任务插件来处理对Nexus服务器的依赖。

我们现在想要为这个ANT项目和我们的其他maven项目使用一个通用的settings.xml文件,以尽量减少麻烦。

ant项目有一个包含“依赖集”的依赖文件

<artifact:dependencies filesetId="foo" settingsFile="ant-settings.xml">
    <dependency ....>
</artifact:dependencies>
<artifact:dependencies filesetId="fum" settingsFile="ant-settings.xml">
    <dependency ....>
</artifact:dependencies>

在ANT项目使用的设置文件中,我们将配置文件设置为“默认激活”。

我们不能将此配置文件放在公共设置文件中,因为它会使maven项目混乱,并且如果没有配置文件,ANT项目将无法构建。

有没有办法做到这一点并让所有项目都满意?

/ J

1 个答案:

答案 0 :(得分:0)

在我们的依赖项文件中,我添加了

<artifact:remoteRepository id="foo" url="nexus path" />

对所有工件:我添加的依赖项

<remoteRepository refId="foo" />

最后。 即:

<artifact:dependencies filesetId="foo" settingsFile="ant-settings.xml">
    <dependency ....>
    <remoteRepository refId="foo" />
</artifact:dependencies>