The following comment has been added to this issue:

     Author: Kristopher Brown
    Created: Tue, 7 Dec 2004 9:43 AM
       Body:
After chatting on the dev mailing list, I came up with the following example to 
illustrate that the context is not passed through to maven invocations 
resulting from maven:maven and maven:reactor.

In order to allow context variables to be passed through it was discussed 
adding a tag to support pushing through of specific variables rather than the 
whole context, hence the creation of maven:contextVariable which takes two 
arguments, 'var' for the name to store the value under, and 'value' for the 
value to add.  I've added the line to the example below inside the reactor tag 
- to test behaviour prior to changes - comment it out.

  <goal name="example:ensure-properties">
    <j:if test="${empty(exampleProp)}">
      <i:ask question="Please enter some text for exampleProp?" 
             answer="exampleProp"/>
    </j:if>
    <maven:param-check value="${exampleProp}" fail="true" 
message="'exampleProp' must be specified"/>
  </goal>

  <goal name="example:goal" 
        prereqs="example:ensure-properties"
        description="Goal">
    <attainGoal name="example:goal-current-project"/>
  </goal>

  <goal name="example:goal-mp"
        prereqs="example:ensure-properties"
        description="Goal for the multiproject set">
    <maven:pluginVar var="multiprojectIncludes" 
plugin="maven-multiproject-plugin" property="maven.multiproject.includes"/>
    <maven:pluginVar var="multiprojectExcludes" 
plugin="maven-multiproject-plugin" property="maven.multiproject.excludes"/>
    <maven:pluginVar var="multiprojectBasedir" 
plugin="maven-multiproject-plugin" property="maven.multiproject.basedir"/>

    <maven:reactor basedir="${multiprojectBasedir}"
                   banner="Running example for:"
                   postProcessing="true" 
                   goals="example:goal-current-project"
                   includes="${multiprojectIncludes}"
                   excludes="${multiprojectExcludes}"
                   ignoreFailures="false">
       <maven:contextVariable var="exampleProp" value="${exampleProp}"/>
     </maven:reactor>
  </goal>

  <goal name="example:goal-current-project"
        description="Calls the goal for current project, use example:goal or 
example:goal-mp rather than this goal directly">
    <maven:param-check value="${exampleProp}" fail="true" 
message="'exampleProp' must be specified"/>
    <ant:echo>exampleProp is ${exampleProp}</ant:echo>
  </goal>

---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/MAVEN-1147?page=comments#action_27580

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MAVEN-1147

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MAVEN-1147
    Summary: <maven:maven/> tag should be able to inherit at least a subset of 
variables.
       Type: Improvement

     Status: Unassigned
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven
 Components: 
             jelly/ant integration
   Versions:
             1.0-rc1

   Assignee: 
   Reporter: Jan-Helge Bergesen

    Created: Tue, 3 Feb 2004 4:43 AM
    Updated: Tue, 7 Dec 2004 9:43 AM
Environment: Windows 2000, J2SDK 1.4.2

Description:
The maven:maven jelly tag should be able to inherit at least a subset of the 
invoker's environment in order to do controlled override of properties set in 
build/project properties.

Either by using something like <ant inherit="true"/> or by context or 
hierarchial naming convention of properties, ie:
my.prop1=a
my.prop2=b
your.prop1=c
...
<maven:maven inherit="my.*"/>


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to