You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Joël Wijngaarde [Us Media]" <jo...@usmedia.nl> on 2004/02/12 12:55:15 UTC

Getting and setting maven (-D) params in maven.xml

Hi, 

how can you set a variable using the maven.xml file which normally is
set using the -D attribute at runtime.

I want to create a custom target "myproject:webapp" which calls:

	maven -Dgoal=webapp multiproject:goal

I currently do:

<goal name="myproject:deploy" description="Build the projects webapps">
    <j:set var"goal value="war:webapp" />
    <maven:maven descriptor="${basedir}/project.xml" 
	goals="multiproject:goal" />
</goal>

Bud this does not seem to wrok. Any ideas?

Regards,

Joel


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


Re: Getting and setting maven (-D) params in maven.xml

Posted by John Casey <jd...@commonjava.org>.
Second one works where the first one didn't, because the maven tag
(<maven:maven.../>) doesn't inherit the environment/context setup in the
parent maven's execution.

-john

On Thu, 2004-02-12 at 08:31, Joël Wijngaarde [Us Media] wrote:
> Hi,
> 
> Well, found out it works when I use the "attainGoal" command. Not sure
> why, but it works.
> 
> / J
> 
> 
> On Thu, 2004-02-12 at 12:55, Joël Wijngaarde [Us Media] wrote:
> > Hi, 
> > 
> > how can you set a variable using the maven.xml file which normally is
> > set using the -D attribute at runtime.
> > 
> > I want to create a custom target "myproject:webapp" which calls:
> > 
> > 	maven -Dgoal=webapp multiproject:goal
> > 
> > I currently do:
> > 
> > <goal name="myproject:deploy" description="Build the projects webapps">
> >     <j:set var"goal value="war:webapp" />
> >     <maven:maven descriptor="${basedir}/project.xml" 
> > 	goals="multiproject:goal" />
> > </goal>
> > 
> > Bud this does not seem to wrok. Any ideas?
> > 
> > Regards,
> > 
> > Joel
> > 
> > 
> > ---------------------------------------------------------------------
> > 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: Getting and setting maven (-D) params in maven.xml

Posted by "Joël Wijngaarde [Us Media]" <jo...@usmedia.nl>.
Hi,

Well, found out it works when I use the "attainGoal" command. Not sure
why, but it works.

/ J


On Thu, 2004-02-12 at 12:55, Joël Wijngaarde [Us Media] wrote:
> Hi, 
> 
> how can you set a variable using the maven.xml file which normally is
> set using the -D attribute at runtime.
> 
> I want to create a custom target "myproject:webapp" which calls:
> 
> 	maven -Dgoal=webapp multiproject:goal
> 
> I currently do:
> 
> <goal name="myproject:deploy" description="Build the projects webapps">
>     <j:set var"goal value="war:webapp" />
>     <maven:maven descriptor="${basedir}/project.xml" 
> 	goals="multiproject:goal" />
> </goal>
> 
> Bud this does not seem to wrok. Any ideas?
> 
> Regards,
> 
> Joel
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
-- 
Us Media
Stadhouderskade 115
1073 AX Amsterdam

t: +31 20 428 6868
f: +31 20 470 6905
w: http://www.usmedia.nl


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