Search code examples
mavenantmaven-pluginmaven-antrun-plugin

How to export custom parent pom properties to a file, from a child pom?


I have a parent pom with some custom properties and I would like to export those properties from one of the child to a file.

I tried maven-antrun-plugin with echo, but this works only with the child properties. I also tried to define child properties and assign the parent properties (e.g. <child.prop>${parent.prop}</child.prop>) but I got the same result.

Update: It worked after I run mvn clean install on the parent.


Solution

  • The parent custom properties are available in child pom only after mvn install on the parent.