【发布时间】:2016-02-06 11:32:16
【问题描述】:
我的项目中有一个 jar 文件,我需要从中删除一个 persistence.xml
我发现了这个问题
Remove file from dependency jar using maven
但它似乎对我不起作用。
我在 pom.xml 中添加了以下内容
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>truezip-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>remove-a-file-in-sub-archive</id>
<goals>
<goal>remove</goal>
</goals>
<phase>package</phase>
<configuration>
<fileset>
<directory>target/app/WEB-INF/lib/jarname/META-INF</directory>
<includes>
<include>persistence.xml</include>
</includes>
</fileset>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
如果 jar 名为 jarname.jar,我应该在路径中提及 .jar。我想不会。如果值得一提,我正在使用 Maven 2.2.1。
【问题讨论】:
-
所以没有帮助。如果其中任何一个是选项,我会做的。我设法通过弄乱 Nexus 存储库并修改 jar 来对其进行排序。我不想这样做,因为我必须在稍后阶段将其改回,但我需要一个解决方案。