I *think* properties straight from a POM override those from a profile. (Anyone more expert than myself, please correct me if I'm wrong)
I would recommend moving the submodules' directory settings into a profile also, so that you can explicitly state at the command line which you want active. If the child and parent need to go to different places during the same build, consider having a separate profiles.xml, whose <profile> elements would contain <properties> for each different directory (and then you could refer to them in the pom as ${properties}: "<directory>${build.directory.for.this.pom}</directory>"). I'm not completely sure how you should be arranging them, since I don't know the details of your project. But I think consistency in having the <directory> set by a profile in all cases would fix your issue of unwanted precendence order. Anyway, check out http://maven.apache.org/guides/introduction/introduction-to-profiles.htm l if you haven't already. Aside from a pretty good explanation of how profiles work, one of the most useful things in there is the command 'mvn help:active-profiles', which will list what profiles are active, so you can see if any are being activated when they shouldn't. Hope that helps, ~Dan Allen -----Original Message----- From: amit kumar [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 3:18 PM To: Maven Users List Subject: Re: build profiles Actually the current setup is the most basic I guess. I was just trying to separate development environment(destination directory for the sub modules) an integration environment( the profile I want to use to specify a location which would get inherited by every sub module so that all of them could be at one place.) For sub modules I am define like. <build> <directory>C:\Final</directory> </build> For parent project(parent of all) I am defining a profile( i think I would have to, to achieve this separation) which would be used when build would be triggered at the time ot Continuous Integration. I am not defining anything else in this profile besides the destination directory. <profiles> <profile> <id>int</id> <build> <directory>C:\Diff</directory> </build> </profile> </profiles> something like mvn -P int Amit On Feb 4, 2008 1:47 PM, Allen, Daniel <[EMAIL PROTECTED]> wrote: > So... you're saying that your <profile> (profile1, according to your > example command-line call below) is defined in/for the parent POM? > > I think I'm not 100% understanding your setup. Could you give me a more > detailed explanation of what profiles and properties you have defined, > where those are, and which ones you do and don't want active? In fact, > if you have some web space somewhere, maybe you could just upload your > POMs and link to them? > > -----Original Message----- > From: amit kumar [mailto:[EMAIL PROTECTED] > Sent: Monday, February 04, 2008 2:33 PM > To: Maven Users List > > Subject: Re: build profiles > > Currently i am not using any profile(tag) for sub modules, I am just > mentioning <directory> tag inside <build> tag. Do i need to have > separate profile to do that? > > regards, > Amit > > On Feb 4, 2008 1:03 PM, Allen, Daniel <[EMAIL PROTECTED]> wrote: > > When I was doing profiles for the first time, I noticed that anything > I > > put in profiles.xml was active by default, and that my dev profile > > overrode my live release profile. This may be your problem. Try > adding: > > > > <activation> > > <activeByDefault>false</activeByDefault> > > </activation> > > > > to the dev profile that is currently overriding the other. In fact, > this > > may or may not be regarded by the community as a "best practice," (I'm > > new at Maven too), but for a project where only one profile should > ever > > be active at a time, I add those lines to all the profiles, and then > > just explicitly call the one I want at the command line with '-P > > profile_name'. > > > > Hope that helps. > > ~Dan Allen > > > > > > > > -----Original Message----- > > From: amit kumar [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 04, 2008 1:58 PM > > To: Maven Users List > > Subject: build profiles > > > > Hi, > > I am trying to have different build profiles for my development > > environment and integration environment. All I want is to have > > different destination directories. My project has sub-modules and at > > the time of Integration when I run the maven build for the parent > > project, the destination directory that I want at the integration > > environment gets overridden by the sub module directory tag. > > > > I have tried something like this. > > > > ParentProject > > -pom.xml have a profile with destination > > directory say C:\final > > > > -Child1 destination directory in the > > build tag D:\dev > > > > -Child2 > > > > > > When I run mvn install -P profile1. The C:\final gets overridden by > > D:\dev. > > > > How shall I go about it? > > > > > > regards, > > Amit > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- > > This message may contain confidential, proprietary, or legally > privileged information. No confidentiality or privilege is waived by any > transmission to an unintended recipient. If you are not an intended > recipient, please notify the sender and delete this message immediately. > Any views expressed in this message are those of the sender, not those > of any entity within the KBC Financial Products group of companies > (together referred to as "KBC FP"). > > > > This message does not create any obligation, contractual or otherwise, > on the part of KBC FP. It is not an offer (or solicitation of an offer) > of, or a recommendation to buy or sell, any financial product. Any > prices or other values included in this message are indicative only, and > do not necessarily represent current market prices, prices at which KBC > FP would enter into a transaction, or prices at which similar > transactions may be carried on KBC FP's own books. The information > contained in this message is provided "as is", without representations > or warranties, express or implied, of any kind. Past performance is not > indicative of future returns. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- > This message may contain confidential, proprietary, or legally privileged information. No confidentiality or privilege is waived by any transmission to an unintended recipient. If you are not an intended recipient, please notify the sender and delete this message immediately. Any views expressed in this message are those of the sender, not those of any entity within the KBC Financial Products group of companies (together referred to as "KBC FP"). > > This message does not create any obligation, contractual or otherwise, on the part of KBC FP. It is not an offer (or solicitation of an offer) of, or a recommendation to buy or sell, any financial product. Any prices or other values included in this message are indicative only, and do not necessarily represent current market prices, prices at which KBC FP would enter into a transaction, or prices at which similar transactions may be carried on KBC FP's own books. The information contained in this message is provided "as is", without representations or warranties, express or implied, of any kind. Past performance is not indicative of future returns. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message may contain confidential, proprietary, or legally privileged information. No confidentiality or privilege is waived by any transmission to an unintended recipient. If you are not an intended recipient, please notify the sender and delete this message immediately. Any views expressed in this message are those of the sender, not those of any entity within the KBC Financial Products group of companies (together referred to as "KBC FP"). This message does not create any obligation, contractual or otherwise, on the part of KBC FP. It is not an offer (or solicitation of an offer) of, or a recommendation to buy or sell, any financial product. Any prices or other values included in this message are indicative only, and do not necessarily represent current market prices, prices at which KBC FP would enter into a transaction, or prices at which similar transactions may be carried on KBC FP's own books. The information contained in this message is provided "as is", without representations or warranties, express or implied, of any kind. Past performance is not indicative of future returns. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]