Hi Alejandro,

> I am trying to create a property <outputFolder> in a parent pom since
> I want all children modules to use a single output folder.

This is a variation of the "${basedir}/.." hack.

See this thread:
http://mail-archives.apache.org/mod_mbox/maven-users/201304.mbox/%3CCADN69ymQJsxB16e=grt63ucr_zx72rkpxkegcfw4k5-0rd8...@mail.gmail.com%3E

In short, you have to override your outputDirectory property in every child
POM.

Doing this is considered somewhat bad practice, but does the job.

Regards,
Curtis

P.S. For a Maven plugin which implements this feature, see:
https://github.com/imagej/imagej-maven-plugin

If others find the set-rootdir feature of imagej-maven-plugin useful, we
could potentially isolate it into its own dedicated plugin.


On Mon, Dec 16, 2013 at 10:54 AM, <alejandro.e...@miranda.com> wrote:

> I am trying to create a property <outputFolder> in a parent pom since I
> want all children modules to use a single output folder. What i tried
> first was defining this property in the parent pom
> <outputFolder>${project.build.directory}</outputFolder>
>
> And then in a child, something like
> <configuration>
>         <outputDirectory>${outputFolder}</outputDirectory>
> </configuration>
>
> However, the property outputFolder gets defined differently based on where
> it is used, so basically, it's the same as if I used this in the children
> <configuration>
>         <outputDirectory>${project.build.directory}</outputDirectory>
> </configuration>
> i.e. the children end up using their own output folder like maven does by
> default. Is there any way to "anchor" that property to be resolved to the
> build directory of the pom where it is defined (the parent pom) and not
> where it is accessed?
> Alejandro Endo | Software Designer/Concepteur de logiciels
> Miranda Technologies | Tel: (514) 333-1772 Ext: 3789
> 3499 Douglas-B.-Floreani, Montréal, QC  H4S 2C6  Canada
> Miranda Technologies is a brand of Belden Inc.
> DISCLAIMER:
> Privileged and/or Confidential information may be contained in this
> message. If you are not the addressee of this message, you may not
> copy, use or deliver this message to anyone. In such event, you
> should destroy the message and kindly notify the sender by reply
> e-mail. It is understood that opinions or conclusions that do not
> relate to the official business of the company are neither given
> nor endorsed by the company.
> Thank You.
>

Reply via email to