You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Jason van Zyl <jv...@maven.org> on 2004/06/15 07:32:19 UTC

Re: project build.properties not overriding user build.properties?

On Tue, 2004-06-15 at 01:37, Vincent Massol wrote:
> Hi,
> 
> Looking at Maven source it seems to me that any property defined in a
> project's build.properties would override that same property defined in
> the user.home build.properties (and that seems logical to me). However
> this is not happening.

The ~/build.properties has always had the final say and overrides
anything defined in any of the other properties files. The relevant
snippet of code is:

Map result = MavenUtils.mergeMaps( new Map[]
        {
            systemProperties,
            userBuildProperties,
            projectBuildProperties,
            projectProperties,
            driverProperties
        } );


Order of precedence is from the top of the list to the bottom. This has
always been the way the properties have worked.

> 
> Is that a wanted behavior?
> 
> Thanks
> -Vincent
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

-- 
jvz.

Jason van Zyl
jason@maven.org
http://maven.apache.org

happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...

 -- Thoreau 


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


RE: project build.properties not overriding user build.properties?

Posted by Jason van Zyl <jv...@maven.org>.
On Tue, 2004-06-15 at 02:16, Vincent Massol wrote:

> Ok. I personally never use a master build.properties but they do on the
> project I'm currently working on. 

I wouldn't call it a master build.properties. I don't have many values
in my ~/build.properties. My definition of maven.repo.local and some jar
override options when I'm doing integration work. 

> I find it strange that something
> global overrides something local. It means I cannot have default
> behaviors that can be overridden. Anything that is not 100% common will
> have to be spread in the different projects. 

m1 is lacking in site default values and group default values but this
is definitely something address in m2.

> Anyway I guess I'm too used to the other way of thinking...
> 
> The hard part is that with this philosophy a project has to be aware of
> all the other maven projects running on that machine. It cannot
> self-defined some properties that will work under any conditions.

You can always stipulate not using ~/build.properties. In m1 to simulate
something like site defaults you might want to look at the geronimo
build.

> Anyway, now I understand how it works I can find workarounds :-)
> 
> Thanks
> -Vincent
> 
> > 
> > >
> > > Is that a wanted behavior?
> > >
> > > Thanks
> > > -Vincent
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > 
> > --
> > jvz.
> > 
> > Jason van Zyl
> > jason@maven.org
> > http://maven.apache.org
> > 
> > happiness is like a butterfly: the more you chase it, the more it will
> > elude you, but if you turn your attention to other things, it will
> come
> > and sit softly on your shoulder ...
> > 
> >  -- Thoreau
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

-- 
jvz.

Jason van Zyl
jason@maven.org
http://maven.apache.org

happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...

 -- Thoreau 


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


RE: project build.properties not overriding user build.properties?

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Jason van Zyl [mailto:jvanzyl@maven.org]
> Sent: 15 June 2004 11:02
> To: Maven Developers List
> Subject: Re: project build.properties not overriding user
> build.properties?
> 
> On Tue, 2004-06-15 at 01:37, Vincent Massol wrote:
> > Hi,
> >
> > Looking at Maven source it seems to me that any property defined in
a
> > project's build.properties would override that same property defined
in
> > the user.home build.properties (and that seems logical to me).
However
> > this is not happening.
> 
> The ~/build.properties has always had the final say and overrides
> anything defined in any of the other properties files. The relevant
> snippet of code is:
> 
> Map result = MavenUtils.mergeMaps( new Map[]
>         {
>             systemProperties,
>             userBuildProperties,
>             projectBuildProperties,
>             projectProperties,
>             driverProperties
>         } );
> 

yes, that's the code I was looking at but I read it the other way around
(I've now read the mergeMaps() algorithm and I can see that it will not
override existing key:value pairs).

> 
> Order of precedence is from the top of the list to the bottom. This
has
> always been the way the properties have worked.

Ok. I personally never use a master build.properties but they do on the
project I'm currently working on. I find it strange that something
global overrides something local. It means I cannot have default
behaviors that can be overridden. Anything that is not 100% common will
have to be spread in the different projects. 

Anyway I guess I'm too used to the other way of thinking...

The hard part is that with this philosophy a project has to be aware of
all the other maven projects running on that machine. It cannot
self-defined some properties that will work under any conditions.

Anyway, now I understand how it works I can find workarounds :-)

Thanks
-Vincent

> 
> >
> > Is that a wanted behavior?
> >
> > Thanks
> > -Vincent
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> 
> --
> jvz.
> 
> Jason van Zyl
> jason@maven.org
> http://maven.apache.org
> 
> happiness is like a butterfly: the more you chase it, the more it will
> elude you, but if you turn your attention to other things, it will
come
> and sit softly on your shoulder ...
> 
>  -- Thoreau
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



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