3

I want to run maven-replacer-plugin just before packaging war. I have find "prepare-package" phase but it triggered before war assembled and all resources copied, but I need to make changes when all resources copied and just before archive create. Is this possible in maven?

BTW, I use maven-2.2.1.

Thanks.

2 Answers2

7

I have found answer in maven replacer plugin WIKI. The trick is to make all things after war:exploded but then use <useCache>true</useCache> property in war plugin configuration. And war:war will use existing files and don't rewrite them.

  • 2
    true didn't work for me, I had to downgrade my maven war plugin to version 2.0.1. – Tiago Peres França Oct 23 '13 at 12:02
  • using the latest version of the maven-war-plugin, 2.6 at the time of this writing, fixes it for me. i also followed the instructions from that wiki and those, combined with the latest version of the maven-war-plugin fixed it for me. – icfantv Dec 08 '15 at 00:25
0

If you mean you need to do something after webapp resources are copied, then no. The war plugin does that in the process of building the war, so you'd need to execute something inside the war plugin, which isn't going to happen without modifying the war plugin itself.

Ryan Stewart
  • 126,015
  • 21
  • 180
  • 199