maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Porter <brett.por...@gmail.com>
Subject Re: change dependency properties in maven.xml [u]
Date Tue, 25 Jan 2005 11:09:31 GMT
ok, I've had a look at the code. sorry, unfortunately there isn't any
compatible way to modify them until 1.1 is released as the old model
doesn't expose the properties object.

For Maven 1.0.x, I think this will work, but it will stop working in Maven 1.1:
${dep.addProperty('dependencyType:lib')}
${dep.resolveProperties()}

I'd strongly encourage seeking a workaround.

Cheers,
Brett

On Tue, 25 Jan 2005 11:01:13 +0000, Dominik Dahlem
<Dominik.Dahlem@cs.tcd.ie> wrote:
> Hi Brett.
> 
> I tried that without success. I have the following code:
> 
>     <j:forEach items="${pom.dependencies}" var="dep">
>       <j:if test="${dep.getGroupId().equalsIgnoreCase('j2meunit')}">
>         ${dep.getProperties().setProperty('dependencyType', 'lib')}
>         <echo>Added dependencyType ${dep.getProperties()}</echo>
>       </j:if>
>     </j:forEach>
> 
> with this output:
> 
> [echo] Added dependencyType []
> 
> if no properties are specified in the project.xml file and this one:
> 
> [echo] Added dependencyType [property:dependencyType:]
> 
> if I specify the property dependencyType in the project.xml file but
> leave it empty.
> 
> It appears to me that setting properties has no effect at runtime.
> Do you have another idea?
> 
> Cheers,
> Dominik
> 
> 
> On Tue, 2005-01-25 at 21:22 +1100, Brett Porter wrote:
> > IIRC, you had to do ${dep.getProperties().setProperty('foo', 'bar')}
> >
> >
> > On Tue, 25 Jan 2005 10:20:06 +0000, Dominik Dahlem
> > <Dominik.Dahlem@cs.tcd.ie> wrote:
> > > Hi Brett. I did search the archives, but I'm afraid I couldn't find a
> > > working solution. I tried another proposed solution [1], but this one
> > > only considered the dependency path disregarding the properties.
> > >
> > > Any help or pointers is appreciated.
> > > Thanks.
> > > Dominik
> > >
> > > [1] http://www.mail-archive.com/users@maven.apache.org/msg06567.html
> > >
> > >
> > > On Tue, 2005-01-25 at 06:33 +1100, Brett Porter wrote:
> > > > this was discussed recently: was there anything in the archives?
> > > >
> > > >
> > > > On Mon, 24 Jan 2005 15:24:04 +0000, Dominik Dahlem
> > > > <Dominik.Dahlem@cs.tcd.ie> wrote:
> > > > > Hi all.
> > > > >
> > > > > I am in a situation where I'd like to change a property for a dependency
> > > > > at runtime. Depending on which goal I'm running it coud have two
> > > > > different values. So far I tried to change the property with:
> > > > >
> > > > >     <j:forEach items="${pom.dependencies}" var="dep">
> > > > >       <j:if test="${dep.getGroupId().equalsIgnoreCase('j2meunit')}">
> > > > >         ${dep.setProperty('dependencyType', 'lib')}
> > > > >       </j:if>
> > > > >     </j:forEach>
> > > > >
> > > > > The output of
> > > > >
> > > > >     <echo>${dep.getProperty('dependencyType')}</echo>
> > > > >
> > > > > is empty.
> > > > >
> > > > > Does anyone know whether this is possible?
> > > > > Any help is appreciated.
> > > > >
> > > > > Thanks a million.
> > > > > Dominik
> > > > >
> > > > > --
> > > > > Dominik Dahlem <Dominik.Dahlem@cs.tcd.ie>
> > > > > -------------------------------------------------------
> > > > > Trinity College Dublin
> > > > > Department of Computer Science,
> > > > > Dublin 2, Ireland
> > > > >
> > > > > tel: (+353) 1-608 1539
> > > > > fax: (+353) 1-677 2204
> > > > > www: http://www.cs.tcd.ie/Dominik.Dahlem/
> > > > > -------------------------------------------------------
> > > > >
> > > > >
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > --
> > > Dominik Dahlem <Dominik.Dahlem@cs.tcd.ie>
> > > -------------------------------------------------------
> > > Trinity College Dublin
> > > Department of Computer Science,
> > > Dublin 2, Ireland
> > >
> > > tel: (+353) 1-608 1539
> > > fax: (+353) 1-677 2204
> > > www: http://www.cs.tcd.ie/Dominik.Dahlem/
> > > -------------------------------------------------------
> > >
> > >
> > >
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> --
> Dominik Dahlem <Dominik.Dahlem@cs.tcd.ie>
> -------------------------------------------------------
> Trinity College Dublin
> Department of Computer Science,
> Dublin 2, Ireland
> 
> tel: (+353) 1-608 1539
> fax: (+353) 1-677 2204
> www: http://www.cs.tcd.ie/Dominik.Dahlem/
> -------------------------------------------------------
> 
> 
>

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


Mime
View raw message