maven


Maven-antrun-plugin modify artifact before war is packaged


I have an application that is built via Maven, the end result being a .war file - which works all well and good.
It pulls a number of dependencies from a repository during the build and uses them within the application. One of these dependencies is a jar file, within the jar file is a zip file and within that zip is one file that I want to remove.
Using maven-antrun-plugin i have managed to move that jar to a tmp location from TARGET and explode the jar file. I then explode the zip file, remove the offending file, package everything back together and put it in TARGET once more.
The problem is that this happens after the WAR file is built so the new jar that i put back into TARGET is not used. I know this is because it has already been packaged so I tried to alter the JAR before this stage using similar to below (Found via: Run an ant task in maven build phase before war is packaged?)
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>deploy-ui</id>
<phase>package</phase>
<inherited>false</inherited>
<configuration>
<target>
<-- JAR was modified in here -->
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<!-- First step is to disable the default-war build step. -->
<id>default-war</id>
<phase>none</phase>
</execution>
<execution>
<!-- Second step is to create an exploded war. Done in prepare-package -->
<id>war-exploded</id>
<phase>prepare-package</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
<execution>
<!-- Last step is to make sure that the war is built in the package phase -->
<id>custom-war</id>
<phase>package</phase>
<goals>
<goal>war</goal>
</goals>
</execution>
</executions>
</plugin>
It successfully runs the ant plugin after the war is exploded but before it has been packaged and therefore it cannot find any file that I reference in the TARGET directory?
Is there anyway to get it so that I can reference files in TARGET before the war is completed? If not can some suggest an alternative.
Note: I cannot upload a new dependency to the repo and/or use a local copy.

Related Links

How to run testNG tests using Maven POM file
publish an installation of hadoop in the local maven repository
org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2 error
Using the properties tag within maven profiles
Embedded tomcat won't let my selenium/jbehave stories run
GWT & Maven: applying code formatter
Best practices in naming conventions on Maven artifactID (is there restriction?)
“Non-resolvable parent POM” with Play framework project using Maven
Keep getting java.lang.OutOfMemoryError: PermGen space error
copy dependencies transitive and not transitive
jetty-maven-plugin setting buffers sizes
Grails refresh-dependencies doesn't download snapshot dependency from local maven repository
Copy test resources from one submodule to the others
What is an uber jar?
Add jar file to Maven Reactor modules list
JAX-WS with Spring integration with Jetty server

Categories

HOME
maven
ionic-framework
omnet++
infragistics
jpeg
win32gui
icloud
baqend
opengl-es-2.0
podio
bs4
multiple-records
webrequest
adfs
nano-server
kentor-authservices
numeral.js
mapserver
static-libraries
quickfix
ups
django-simple-history
workload-scheduler
tostring
pc
footer
emulator
orleans
arabic
mmap
pingfederate
entitlements
neo4j-spatial
wtx
jspm
nat
bluestacks
exuberant-ctags
caret
xmlreader
dartium
nand2tetris
checkboxlist
businessworks
skeleton-css-boilerplate
logfiles
fault
azure-application-gateway
hendrix
return-value
colorama
setter
directory-structure
libusb-win32
google-perftools
account-kit
query-performance
pycaffe
ableton-live
static-ip-address
measures
contact-list
persist
python-stackless
cloudbees
ford-fulkerson
rgeo
embedded-code
browser-bugs
responsive-images
sonarqube5.1.2
graph-api-explorer
umbraco6
nsmutabledictionary
system.reflection
asp.net-dynamic-data
file-copying
googlemock
onactivityresult
mbr
page-layout
ms-project-server-2010
ember-app-kit
flashvars
angularjs-controller
pvrtc
jquery-knob
coderush
venn-diagram
objective-c-2.0
nsmanagedobject
dotnethighcharts
hirefire
ecl
imac
gin
thunderbird-lightning
zend-decorators
putchar
windows-live-messenger

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App