【问题标题】:Ant and using maven dependencies and settings fileAnt 和使用 maven 依赖项和设置文件
【发布时间】:2015-03-13 11:44:50
【问题描述】:

我们有一个使用 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

【问题讨论】:

    标签: ant maven-ant-tasks


    【解决方案1】:

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

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

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

    <remoteRepository refId="foo" />
    

    最后。 即:

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

    【讨论】:

      猜你喜欢
      • 2014-05-25
      • 2012-10-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-07
      相关资源
      最近更新 更多