Last Updated: February 25, 2016
·
1.597K
· joão

Maven Web Resources Filtering in IDEA

There is one thing that IDEA doesn't do better than Eclipse: handling the maven-war-plugin web resources filtering. So, I built a Python script to manually handle web resources filtering using the maven-war-plugin configuration inside the pom.xml file . It's dirty but it gets the job done, and I keep the exploded war, hot deploys, etc.

I used it as an external tool that is ran after the "Build mywar:exploded artifact". The script needs two arguments: the first is the path to the project directory (the one that contains the pom.xml file, I didn't find a macro that returns it correctly), the second is the profile id which contains the properties you want to replace. I attached the script in case someone wants to give it a try. It was well worth the time I spent building it.

The script is located at:
https://github.com/joaomc/idea-utils/blob/master/force-maven-web-resource-filter.py