Access to parent properties when creating a module from the Maven archetype

I have several maven archetypes that I use to create a multi-module maven project.

I have the required property in the archetype that I use to generate the parent project. This is added as a property in pom.xml for the project.

Then I create a module inside the project using another archetype. I would like the same value to be replaced in some resources of this module.

It seems wrong to return it as a property again when the second archetype is called.

Is it possible to refer to the properties of the parent project during the archetype generation process for the module? I want the value to be replaced with files in the src tree of the module, and not the owner, so that it is replaced in the target folder.

Thanks for any help.

+3
source share
1 answer

In Maven 3, you can access parent properties with ${project.parent.x}.

More information can be found in the Maven Properties Guide .

+6
source

All Articles