Search code examples
maven-3

To convert a property in maven pom file and copy it to a particular location


I want to replace all dots in project.version property with underscore i.e 5.7 -->5_7 in my maven pom.xml and copy only the folder having the replaced value while packing it as jar i.e src/main/resources/5_7 to db/oracle/5_7


Solution

  • Things in Maven don't work like that exactly.

    If you'd like to do this via the maven-resources-plugin, then this would not be possible.

    As a workaround, you might end up wanting to use the maven-antrun-plugin and doing the property-changing and copying from there.