如何使用maven task for ant排除ant构建中的可传递依赖关系?

如何使用maven task for ant排除ant构建中的可传递依赖关系?,maven,ant,maven-ant-tasks,Maven,Ant,Maven Ant Tasks,如何在ant的maven任务中排除可传递依赖项。作用域:运行时和提供的在这种情况下似乎没有任何帮助。 这是我的build.xml <artifact:remoteRepository url="https://mynexus/" id="remote.repository"/> <artifact:dependencies filesetId="dependency.fileset" useScope="runtime"> <dependency ver

如何在ant的maven任务中排除可传递依赖项。作用域:运行时和提供的在这种情况下似乎没有任何帮助。 这是我的build.xml

<artifact:remoteRepository url="https://mynexus/" id="remote.repository"/>

<artifact:dependencies filesetId="dependency.fileset" useScope="runtime">
     <dependency version="1.7.0" artifactId="commons-beanutils" groupId="commons-beanutils"/>
</artifact:dependencies>


commons beanutils具有我需要排除的依赖性commons日志记录。

我认为Maven任务不支持此功能。你有没有考虑改用ApacheIvy?以下两个示例演示了排除功能

该任务对于管理类路径非常有用:

<ivy:cachepath pathid="compile.path">
  <dependency org="commons-beanutils" name="commons-beanutils" rev="1.7.0" conf="default">
    <exclude module="commons-logging"/>
  </dependency>
</ivy:cachepath>

该任务可用于本地下载和保存文件:

<ivy:retrieve pattern="lib/[artifact]-[revision](-[classifier]).[ext]">
  <dependency org="commons-beanutils" name="commons-beanutils" rev="1.7.0" conf="default">
    <exclude module="commons-logging"/>
  </dependency>
</ivy:retrieve>

maven ant支持此排除,请使用RTFM

正如

<artifact:dependencies filesetId="dependency.fileset" useScope="runtime">
  <artifact:dependency version="1.7.0" artifactId="commons-beanutils" groupId="commons-beanutils">
    <exclusion groupId="commons-logging" artifactId="commons-logging">
  </<artifact:dependency>
</artifact:dependencies>


我正在尝试使用maven anttask@user3199100理解。如上所述,我不知道Maven ANT任务支持您所需的功能。您引用的链接声明元素名称为exclusion not exclude(可能在您发布链接后发生了更改)@cproinger谢谢,我刚才犯了一个错误,现在标记名称已更正