打包在我的ear文件中的jarModule包含一个persistence.xml文件,我需要在打包阶段删除该文件。我能做的最好的事情是:
<JarModule>
<groupId>groupId</groupId>
<artifactId>artifactId</artifactId>
<unpack>true</unpack> -->
</JarModule>
<packagingExcludes>*/META-INF/persistence.xml,*/META-INF/orm.xml</packagingExcludes>但我需要在包装耳朵之前重新包装好罐子。
有什么建议吗?
谢谢
发布于 2014-03-27 20:24:28
您可以使用TrueZIP Maven PLugin从归档中删除文件:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>truezip-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>remove-from-jar</id>
<phase>prepare-package</phase>
<goals>
<goal>remove</goal>
</goals>
<configuration>
<fileset>
<directory>${project.build.directory}\<someFolders>\<I-contain-persistence-xml.jar></directory>
<includes>
<include>**\persistence.xml</include>
<include>**\orm.xml</include>
</includes>
</fileset>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>档案(*.jar、*.war等)可以像TrueZIP中的目录一样使用。如usage page所示,您可以轻松地移动或复制归档中的文件。
https://stackoverflow.com/questions/17987891
复制相似问题