How do I filter resources based on values from a properties file?
Author: Deron Eriksson
Description: This tutorial describes how to filter resources based on properties in a file.
Tutorial created using: Windows Vista || JDK 1.6.0_04 || Eclipse Web Tools Platform 2.0.1 (Eclipse 3.3.1)


Page: < 1 2

(Continued from page 1)

Now, I'll perform a "mvn clean process-resources" on the project.

Executing 'mvn clean process-resources' on 'aproject'

This generates the target/classes/textfile.txt file.

textfile.txt in target/classes

If we examine the contents of the textfile.txt file, we can see that it has been filtered to contain the property values. The project.artifactId value came from the pom.xml file, and the my.property value came from the myfilter.properties file.

target/classes/textfile.txt

this is a test
artifact id: aproject
my.property: hamburger and fries
Page: < 1 2