maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoît Berthonneau <ben...@berthonneau.com>
Subject RE: property relative to pom
Date Fri, 20 Dec 2013 21:52:50 GMT
Hi Alejandro,

I assume that all your children are at the same level, did you try?
<configuration>
   <outputDirectory>../target</outputDirectory>
</configuration>

Anyway, this (strange) need could lead to undesired border effects: what
happened during clean goal on a child? --> all others children are cleaned;
what happen when only one module is compiling?

Are you sure that you need to do that?

Regards,
Benoît.


-----Message d'origine-----
De : Alejandro.Endo@miranda.com [mailto:Alejandro.Endo@miranda.com] 
Envoyé : vendredi 20 décembre 2013 21:23
À : Maven Users List
Objet : Re: property relative to pom

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/%3CCADN69ym
QJsxB16e=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.


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


Mime
View raw message