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 Fri, 20 Dec 2013 23:03:49 GMT
Hi Alejandro,

> I don't see the point of overwriting the property in every child pom,
> the whole point of having the property is to define it only once in
> the parent pom.

Yes, you have to override the rootdir property in every child. But you
don't have to replicate e.g. plugin configuration in every POM. You can
just reference the rootdir property in the base POM and then all the
children inherit the configuration and all work.

Agreed that it is less optimal than if Maven just had this property to
begin with.

Regards,
Curtis


On Fri, Dec 20, 2013 at 2:23 PM, <Alejandro.Endo@miranda.com> wrote:

> Thank you for the reply Curtis.
>
> But I'm not sure I understand. I don't see the point of overwriting the
> property in every child pom, the whole point of having the property is to
> define it only once in the parent pom. If i have to define the property in
> every child i will just configure the plugin without properties in each
> child pom like this
>
> <configuration>
>    <outputDirectory>${basedir}/../target</outputDirectory>
> </configuration>
>
> Did I misunderstand your comment about overriding the property in every
> child?
>
> Thanks again,
> Alejandro Endo | Software Designer/Concepteur de logiciels
>
>
>
>
> From:   Curtis Rueden <ctrueden@wisc.edu>
> To:     Maven Users List <users@maven.apache.org>,
> Date:   2013-12-19 18:01
> Subject:        Re: property relative to pom
> Sent by:        ctrueden.wisc@gmail.com
>
>
>
> 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.
> >
>
>
> 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