My spring+maven project has .properties and .xml resource files. I want to set up filtering for .properties only excluding all spring xml configs. This is pretty straightforward thing:
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
<excludes>
<exclude>**/*.properties</exclude>
</excludes>
</resource>
<resource>
<filtering>false</filtering>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
But now I want to apply filter to one concrete xml file, say env-config.xml. So the problem is how to apply filters to all .properties files and only one specific xml file?
Try to add one more resource element
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>path/to/file.xml</include>
</includes>
</resource>
Not sure if it works, I don't have maven right now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With