I normally define a property called something like 'multiproject.basedir' in every POM - or at least in every POM that needs to reference a path in the parent project dir.

Some examples:
 - in 'parent/pom.xml' it's:
     <multiproject.basedir>${basedir}<multiproject.basedir>
 - in 'parent/sub1/pom.xml' it's:
     <multiproject.basedir>${basedir}/..<multiproject.basedir>
 - in 'parent/sub1/sub2/pom.xml' it's:
     <multiproject.basedir>${basedir}/../..<multiproject.basedir>

With this, You have a common property to locate Your configuration in the parent project dir.


Another approach would be similar to Sharing Assembly Descriptors [1]. It's just little more complicated:

1. Create module that contains the all the configuration files. It should use the Assembly plugin to package the file into a ZIP (or TAR or whatever) archive and install it to the local repo.

2. Use the dependency:unpack goal to extract the contents of the ZIP archive, that was created by the new module, and bind it to the 'pre-site' phase. You can do this configuration once in the parent POM and inherit it to all modules.

2.a. If You like/need, You could use the resources:copy-resources goal to overwrite the extracted configuration files with custom files that are placed in the modules. Also bind it to the 'pre-site' phase. This configuration can also be inherited from the parent to all module POMs.

3. Configure the site plugins to use the unpacked configuration files in each module. Even this can be done in the parent POM and inherited to the modules.


Kind regards, Marc


[1] http://maven.apache.org/plugins/maven-assembly-plugin/examples/sharing-descriptors.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to