问题描述:

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.

相关阅读:
Top