Issue Details (XML | Word | Printable)

Key: MAVEN-1147
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Jan-Helge Bergesen
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Maven 1

<maven:maven/> tag should be able to inherit at least a subset of variables.

Created: 03/Feb/04 04:43 AM   Updated: 11/Apr/06 05:17 PM
Return to search
Component/s: jelly/ant integration
Affects Version/s: 1.0-rc1
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Text File maven-HEAD.patch (3 kB)
2. Text File maven-jelly-tags-HEAD.patch (8 kB)
3. Text File maven-jelly-tags-MAVEN-1_0_1-BRANCH.patch (8 kB)

Environment: Windows 2000, J2SDK 1.4.2


 Description  « Hide

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.*"/>



Brett Porter made changes - 21/Feb/04 07:08 PM
Field Original Value New Value
Fix Version/s 1.1 [ 10211 ]
Jason van Zyl made changes - 21/Jul/04 09:54 AM
Fix Version/s 1.1 [ 10211 ]
Kristopher Brown added a comment - 07/Dec/04 09:43 AM

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>


Kristopher Brown added a comment - 07/Dec/04 10:29 AM

Patch to maven project to provide methods to allow a map of variables to be passed into a context when attainGoals is called


Kristopher Brown made changes - 07/Dec/04 10:29 AM
Attachment maven-HEAD.patch [ 13507 ]
Kristopher Brown added a comment - 07/Dec/04 10:30 AM

Patch to maven-jelly-tags to provide a contextVariable tag for adding variables to contexts spawned from maven and reactor tags.


Kristopher Brown made changes - 07/Dec/04 10:30 AM
Attachment maven-jelly-tags-HEAD.patch [ 13508 ]
Kristopher Brown added a comment - 07/Dec/04 10:31 AM

Patch to maven-jelly-tags to provide a contextVariable tag for adding variables to contexts spawned from maven and reactor tags.


Kristopher Brown made changes - 07/Dec/04 10:31 AM
Kristopher Brown added a comment - 07/Dec/04 10:32 AM

I created patches for maven-jelly-tags for both the 1.0.1 BRANCH and HEAD as I was unable to test the HEAD patch.


Brett Porter made changes - 08/Dec/04 04:30 AM
Fix Version/s 1.1-beta-1 [ 11371 ]
Brett Porter made changes - 16/May/05 02:52 AM
Fix Version/s 1.1-beta-2 [ 10211 ]
Fix Version/s 1.1-beta-1 [ 11371 ]
Vincent Massol made changes - 11/Aug/05 11:43 AM
Workflow jira [ 23562 ] Maven [ 38177 ]
Brett Porter made changes - 23/Aug/05 05:54 AM
Fix Version/s 1.1-beta-2 [ 10211 ]
Fix Version/s 1.1-rc1 [ 11971 ]
Brett Porter made changes - 08/Mar/06 10:47 PM
Workflow Maven [ 38177 ] Maven New [ 51766 ]
Arnaud Heritier made changes - 11/Apr/06 05:17 PM
Fix Version/s 1.1-rc1 [ 11971 ]
Fix Version/s  1.1-beta-4 [ 12553 ]