Search code examples
maven-2

Maven module properties from another module


I have a multi-module project. In one of the modules I'm generating classes from wsdl. In the pom of this module I need some properties of another module. (build.directory, outputDirectory etc)

It something like this possible?

${project.parent.module.0.build.directory}

I think I saw the above somewhere. Didn't bother testing it because doing module.0 would mean it's dependent on the order in which modules are declared in the parent pom.

Is there a elegant way of doing what I want?


Solution

  • The proper way to do this is to have a parent. Define the properties in there and then simply use that as the parent in your other modules. That way you can easily share the properties across your modules.