maven assembly-忽略zip依赖的依赖性

时间:2011-11-09 03:40:48

标签: dependencies maven-3 maven-assembly-plugin

指定ZIP类型的依赖关系时,是否可以在打包/组装工件后忽略其依赖关系?

<dependency> 
  <groupId>com.groupId.</groupId> 
  <artifactId>testProject</artifactId> 
  <version>1.0-SNAPSHOT</version> 
  <type>zip</type> 
</dependency> 

我在汇编文件中尝试*作为排除,但它似乎没有任何影响

<assembly>
  <id>release</id>
  <formats>
    <format>dir</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <moduleSets>
    <moduleSet>
      <excludes>
        <exclude>*</exclude>
      </excludes>
    </moduleSet>
  </moduleSets>
</assembly>

谢谢!

1 个答案:

答案 0 :(得分:1)

如果我正确理解了您的问题,您希望exclude 传递依赖一个dependency类型的zip

  <dependencySets>
    <dependencySet>
      <includes>
        <include>com.groupId:testProject:zip</exclude>
        <useTransitiveDependencies>false</useTransitiveDependencies>
      </includes>
    </dependencySet>
    ....
  </dependencySets>

您可以在多模块项目中使用moduleSet