Reputation: 365
Is there any possibilities to replace some file after "mvn clean install" command in JAR, WAR and EAR package?
I would like to do something like:
How can I do this?
Upvotes: 1
Views: 1068
Reputation: 328614
Move the build step 1 into a different project or an independent module which installs the result in the places where Maven will look (i.e. in the local repository). mvn file:install
is your friend.
Or use Maven Antrun plugin and the generate-sources
or compile
phase.
That way, the special build in step 1 will become just another dependency.
Maven also has a JSP compiler which you can use in step 3 to produce another dependency.
Use the Maven Antrun plugin to produce the custom web.xml
and other file descriptors and have an independent module collect everything in a WAR.
So you should split your build into several, independent modules. One just compiles the code. The next step compiles the JSPs (since they use the code from step 1). Next, compile a WAR from that (no Java code is compiled in this step). Lastly, another module that builds an EAR.
Upvotes: 1