I just want to use maven placeholder in my Java class at compile time in order to reduce duplication.
Something like that:
pom.xml
Even though it's not a very nice solution it is possible with the default maven resource plugin.
First you need to specify the resource plugin.
src/main/java
true
../filtered-sources/java
src/main/resources
true
Afterwards you will need to change the 'default' configuration of the compiler plugin.
target/filtered-sources/java