You can't do exactly what you are aiming to do dynamically but you could hard code that structure into your pom's.
Look into the property; project.build.directory If you defined that in the respective pom's as below; project.build.directory=/tmp/grandfarther/target project.build.directory=/tmp/grandfarther/farther/target project.build.directory=/tmp/grandfarther/farther/son/target in the respective pom's you could create the structure your after. Because grandfarther, farther, son are arbitrary directory names and maven doesn't care what it's currently directory name is and only modules configuration only needs to point to a directory with a pom in. Another question is why do you want/need this structure as i often find the answer to that the real root cause. John On 30 May 2014 04:28, Thai Dang Vu <[email protected]> wrote: > Hi All, > > I have a multi-module project in the /home/me/projects/grandfather like > this: > > grandfather > | > |---- pom.xml > | > |---- father > | > |---- pom.xml > | > |---- son > | > |---- pom.xml > > If I build that project, I will have these target directories: > /home/me/projects/grandfather/target, > /home/me/projects/grandfather/father/target and > /home/me/projects/grandfather/father/son/target. > > > Is there anyway to modify only 1 pom.xml (it doesn't matter if it is > grandfather's or father's or son's) so that the target directories are > /tmp/grandfather/target, /tmp/grandfather/father/target and > /tmp/grandfather/father/son/target? > > Regards.
