You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Alastair Rodgers <al...@phocis.com> on 2003/10/15 12:46:46 UTC

Property inheritance

Hello, 

I've just started using Maven over the last couple of days, and I must say, my first impressions are very positive (I'm used to dealing with lots of nearly-identical Ant scripts!). Thanks. 

I've been trying to use property inheritance, and I gathered from the mailing list archive that project.properties & build.properties aren't inherited. I tried to get round this by creating a global.properties file and manually loading the properties from it in my base maven.xml: 

  <jelly-core:set var="project.root" value="${pom.parentBasedir().getParentFile().getCanonicalFile()}"/>
  <jelly-util:properties file="${project.root}/etc/global.properties"/>

In global.properties I have: 

  maven.repo.local=/usr/local/data/maven/repository

I then have a sub-project which inherits from this base. If I run, say "maven jar" on the sub-project and dump the value of maven.repo.local to the console from the sub-project's maven.xml, I find it has the desired value (from global.properties). However, Maven is still actually using the default repository (/home/<user>/.maven/repository to do the build) - e.g. if I delete this dir, Maven creates it and starts downloading all the jars again. 

Is there a way round this problem? 

Thanks, 
Al.


Re: Property inheritance

Posted by Paul Libbrecht <pa...@ags.uni-sb.de>.
I've found it easier to simply add in a common bin directory, a modified 
copy of the maven script with the added properties.

Paul


khote wrote:
> set a global
> export MAVEN_HOME_LOCAL=/mavenrepository
> or some such place.  Put that in your /etc/profile so everybody shares it.
> 
> ----- Original Message ----- 
> From: "Alastair Rodgers" <al...@phocis.com>
> To: <us...@maven.apache.org>
> Sent: Wednesday, October 15, 2003 3:46 AM
> Subject: Property inheritance
> 
> 
> 
>>Hello,
>>
>>I've just started using Maven over the last couple of days, and I must
> 
> say, my first impressions are very positive (I'm used to dealing with lots
> of nearly-identical Ant scripts!). Thanks.
> 
>>I've been trying to use property inheritance, and I gathered from the
> 
> mailing list archive that project.properties & build.properties aren't
> inherited. I tried to get round this by creating a global.properties file
> and manually loading the properties from it in my base maven.xml:
> 
>>  <jelly-core:set var="project.root"
> 
> value="${pom.parentBasedir().getParentFile().getCanonicalFile()}"/>
> 
>>  <jelly-util:properties file="${project.root}/etc/global.properties"/>
>>
>>In global.properties I have:
>>
>>  maven.repo.local=/usr/local/data/maven/repository
>>
>>I then have a sub-project which inherits from this base. If I run, say
> 
> "maven jar" on the sub-project and dump the value of maven.repo.local to the
> console from the sub-project's maven.xml, I find it has the desired value
> (from global.properties). However, Maven is still actually using the default
> repository (/home/<user>/.maven/repository to do the build) - e.g. if I
> delete this dir, Maven creates it and starts downloading all the jars again.
> 
>>Is there a way round this problem?
>>
>>Thanks,
>>Al.
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org



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


Re: Property inheritance

Posted by khote <kh...@mminternet.com>.
set a global
export MAVEN_HOME_LOCAL=/mavenrepository
or some such place.  Put that in your /etc/profile so everybody shares it.

----- Original Message ----- 
From: "Alastair Rodgers" <al...@phocis.com>
To: <us...@maven.apache.org>
Sent: Wednesday, October 15, 2003 3:46 AM
Subject: Property inheritance


> Hello,
>
> I've just started using Maven over the last couple of days, and I must
say, my first impressions are very positive (I'm used to dealing with lots
of nearly-identical Ant scripts!). Thanks.
>
> I've been trying to use property inheritance, and I gathered from the
mailing list archive that project.properties & build.properties aren't
inherited. I tried to get round this by creating a global.properties file
and manually loading the properties from it in my base maven.xml:
>
>   <jelly-core:set var="project.root"
value="${pom.parentBasedir().getParentFile().getCanonicalFile()}"/>
>   <jelly-util:properties file="${project.root}/etc/global.properties"/>
>
> In global.properties I have:
>
>   maven.repo.local=/usr/local/data/maven/repository
>
> I then have a sub-project which inherits from this base. If I run, say
"maven jar" on the sub-project and dump the value of maven.repo.local to the
console from the sub-project's maven.xml, I find it has the desired value
(from global.properties). However, Maven is still actually using the default
repository (/home/<user>/.maven/repository to do the build) - e.g. if I
delete this dir, Maven creates it and starts downloading all the jars again.
>
> Is there a way round this problem?
>
> Thanks,
> Al.
>
>


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