maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Max Cooper <...@maxcooper.com>
Subject [m1.1-b-2] how can I initialize a variable/prop just once and share with subprojects in multiproject build?
Date Mon, 16 Jan 2006 23:14:59 GMT
I want to initialize a variable or property just once at the beginning
of a multiproject build and then be able to access that value in any of
the subprojects. Ideally, running a subproject build on it's own would
also initialize the value.

For instance, so far I have something like this in my shared,
common/maven.xml file:

<preGoal name="build:start">
  <j:if test="${svnRevision == null}">
    <ant:echo>Getting revision...</ant:echo>
    <!-- code to get svn revision omitted, but I can post it if anyone
is interested -->
    <j:set var="svnRevision" value="XXXXXX"/>
  </j:if>
</preGoal>

This doesn't work -- "Getting revision..." is echoed for each subproject
build, which means that svnRevision isn't set in the context of each of
the individual builds. I don't actually think this code should work (it
makes sense that each subproject *would* have it's own independent
instance of the svnRevision variable) -- I am just looking for tips
about what I might change to get it to work. I just don't know where I
can "stash" the value so that it will be available in the subproject
builds.

Thanks,
-Max


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


Mime
View raw message