Thursday, April 16, 2020

Remove a file within the dependency jar from moven ear

https://stackoverflow.com/questions/2830837/remove-file-from-dependency-jar-using-maven

Parent pom has multiple children and all children refers to a scheduler task except 1. Child 1 is deployed to VM1 JBoss, child 2 is deployed to VM2 JBoss ..
For JBoss configuration, it contains the item for scheduler tasks (like cron information) which is not needed on child 3. In this case, needs exclude the spring-tasks.xml from the core*.jar.

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>truezip-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>remove-****</id>
<goals>
<goal>remove</goal>
</goals>
<phase>package</phase>
<configuration>
<fileset>
<directory>target/***_MDB-${revision}/lib/**Core-${revision}.jar/META-INF/spring/context</directory>
<includes>
<include>**/spring-tasks.xml</include>
</includes>
</fileset>
</configuration>
</execution>
</executions>
</plugin>

No comments:

Post a Comment