Exclude a file while deploying for specific environment using pom.xml

I have 2 ProxyEndPoint xml files, default.xml and test.xml.


While deploying it to some environment, test.xml file should not be added in the deployed

(i.e., compressed) folder. How to exclude it using pom.xml


Thanks in Advance

4 1 242
1 REPLY 1

In pom.xml add an exclude tag for profile which you need.

For Ex:

<exclude.test>path of the file that you want to exclude</exclude.test>

And in maven-resources-plugin while copying-node-resources, add

<exclude>${exclude.test}</exclude>

in excludes tag.

While giving path in <exclude.test> if we add prefix as "not-" before the path, it will not exclude the file specified. If we don't specify any prefix, it will exclude while copying.

Very happy that i only identified the solution.