You tried to use resource plugin execution. As far as I know, you can point it to your Java source and use its normal filtering.
http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html
<properties> <my.name>chad</my.name> <java.property>//comment</java.property> </properties> <build> <sourceDirectory>target/processed-source/java</sourceDirectory> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> <resource> <directory>src/main/java</directory> <filtering>true</filtering> <targetPath>../processed-source/java</targetPath> </resource> </resources> </build>
So, the first thing that you direct the processed java source to a special folder in the destination directory. Then you need to reconfigure the compiler plugin to NOT compile the unfiltered source and instead compile the new source. Please note that, like all maven stuff, you can customize a lot more than that.
This is a blog post .
source share