maven - Running antrun during war:exploded -


After the explosion has been done with the Directory War plugin do I need to copy some files for a Maven build It is possible to run the entrance plugin during or after the war: Explosion target? If so, how do I do this? I have tried:

  & lt; Build & gt; & Lt; Plugins & gt; & Lt; Plugin & gt; & Lt; ArtifactId & gt; Maven-antrun-plugin & lt; / ArtifactId> & Lt; Hanging & gt; & Lt; Execution & gt; & Lt; Step & gt; War & lt; / Step & gt; & Lt; Goals & gt; & Lt; Goal & gt; Explosion & lt; / Target & gt; & Lt; / Targets & gt; & Lt; Configuration & gt; & Lt; Functions & gt; & Lt; Echo & gt; Running Ant Task ... & lt; / Echo & gt; & Lt; / Functions & gt; & Lt; / Configuration & gt; & Lt; / Execution & gt; & Lt; / Hanging & gt; & Lt; / Plugin & gt; & Lt; / Plugins & gt; & Lt; / Create & gt;   

And many other variables but it may not seem to run.

Moderation I want to run an ant task to fight completely: war is also there, but when I come to her, I will cross this bridge.

There are at least two ways to get it:

Using direct invitation to plugins

When calling mvn war: blast oder mvn war: war , you can only specify Call the specific goal of the plugin No other plugins are executed. Execution defined in pom.xml is not relevant. As a result, you can only call multiple plug-ins targets, for example mvn war: explosion entrant: run .

But be careful while creating several modules: mvn war: explosion entrant: run warrant for each module runs antrun while MVN war: explosion;

Use the lifecycle binding of plugins

when calling

mvn pre-integration-test , You call all the steps up to the pre-integration test. You can define a war plugin execution for the purpose of "Explosion" in the phase "Package" and an Entry Performance for "Run" in the stage "pre-integration test".


There is no step "war" in the default lifecycle, so your example above will not work with the default lifecycle. And for a custom lifecycle with custom steps, you need custom plugins.

Comments