You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Scott Eade <se...@backstagetech.com.au> on 2003/01/30 12:29:55 UTC

Changing properties that affect a goal in a preGoal

Short question:

Should a property I set in a preGoal retain it's value for the goal itself
and if not how can I achieve this?

Long version:

I have a turbine app that I am in the process of mavenizing.

With ant I had a number of targets for building deployment targets for
different servers (the servers use different servlet names as well as other
properties that I filter as part of the build process).

I am attempting to do the same thing with maven, but the approach I am
taking is not working.

I have env1.properties and env2.properties that define the base directory to
which I want the webapp to be generated.

I have a pregoal name="war.webapp" that reads the appropriate env?properties
file (depending on a property I set at the command line) and then sets
maven.war.build.dir to a value that is computed from a property obtained
from the env?properties file.

My problem is that even though an echo at the end of the preGoal shows the
property set to the value I desire, it clearly doesn't have this value in
the goal itself.

Is there a way to make this work, or alternatively a better approach to what
I am attempting to do?

Thanks,

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
.Mac Chat/AIM: seade at mac dot com
 


Re: Changing properties that affect a goal in a preGoal

Posted by Scott Eade <se...@backstagetech.com.au>.
On 30/01/2003 10:29 PM, "Scott Eade" <se...@backstagetech.com.au> wrote:

> Should a property I set in a preGoal retain it's value for the goal itself
> and if not how can I achieve this?

I managed to make this work by making my own goal that included the code
from the preGoal and then uses attainGoal to execute the goal whose
properties I want to alter.

So I have answered my own question.

Cheers,

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
.Mac Chat/AIM: seade at mac dot com