maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curtis Rueden <ctrue...@wisc.edu>
Subject Re: property relative to pom
Date Thu, 19 Dec 2013 23:01:59 GMT
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-0Rd8FqA@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.Endo@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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message