0
votes

We have for our application a resource bundle where we need the umlauts written as escaped unicode values (\u00f6 for ö).

Because for some builds, we need different texts and in order to not have to copy all the resource file for the other maven profile, I have added a maven filter file, that places the corresponding text into the resource bundle property file (webResources of the maven war plugin). This works very well except that during filtering maven transforms my \u00f6 to ö and thus breaks our resource bundle.

mylan.properties:
myMessage.title=${myProperty.to.replace}

-> filter with filter.properties:
myProperty.to.replace=Just some \u00f6 to show.

-> result:
myMessage.title=Just some ö to show.

but should be:
myMessage.title=Just some \u00f6 to show.

How can I tell maven to NOT do this replacement during filtering webResources?

Thanks for any hint!
Aurel

This is my maven config for packaging:

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>3.0.0</version>
                        <configuration>
                            <classifier>XYZ</classifier>
                            <warName>${project.artifactId}${svn_revision.padded}</warName>
                            <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
                            <filters>src/main/config/filter.properties</filters>
                            <webResources>
                                ...
                                <resource>
                                    <!-- needs to be here because of env dependent filtering -->
                                    <filtering>true</filtering>
                                    <directory>src/main/resources</directory>
                                    <targetPath>WEB-INF/classes</targetPath>
                                </resource>
                                ...
                            </webResources>
                        </configuration>
                    </plugin>
1

1 Answers