The following features are described in this document:
It may be necessary to filters some properties in a file and ignore another. The filtering mechanism won't touch a token that is not recognized (i.e. that represents an unknown property). This won't work if the property is known obviously so it should be escaped explicitely.
The following configuration defines the value of the escapeString which will stop the interpolation of a property if it starts with that value
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> <version>3.0.2</version> <configuration> <filtering>true</filtering> <escapeString>\</escapeString> [...] </configuration> </plugin> </plugins> </build>
Assuming the following file
jdbc.url=${db.url} jdbc.user=${db.username} jdbc.password=${db.password}
Filtering the content of such a file with this config will produce this content. Note that that the escaped property can now be filtered the usual way later if necessary!
jdbc.url=jdbc:oracle:thin:@localhost:1521:orcl jdbc.user=someuser jdbc.password=${db.password}
Filtering binary files corrupt them so it may be necessary to exclude files from filtering based on the extension. To do so, configure the plugin as follow
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> <version>3.0.2</version> <configuration> <filtering>true</filtering> <nonFilteredFileExtensions> <nonFilteredFileExtension>png</nonFilteredFileExtension> <nonFilteredFileExtension>jpeg</nonFilteredFileExtension> </nonFilteredFileExtensions> [...] </configuration> </plugin> </plugins> </build>