Issue Details (XML | Word | Printable)

Key: MPMULTIPROJECT-58
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Lucas Persson
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Maven 1.x Multi-Project Plugin

Possibllity to re-execute multiproject:projects-init

Created: 05/Sep/05 05:06 AM   Updated: 22/Nov/05 05:11 PM   Resolved: 22/Nov/05 05:11 PM
Return to search
Component/s: None
Affects Version/s: 1.4.1
Fix Version/s: 1.5

Time Tracking:
Not Specified

File Attachments: 1. Text File MPMULTIPROJECT-58.txt (3 kB)

Environment: windowsXP


 Description  « Hide

If a custom goal is defined which wants to call the multiproject plugin twice with different value on
the maven.multiproject.includes property the goal multiproject:projects-init must be executed twice.

Example:
<goal name="release-ejb-client">
<!-- dummy call to init the plugin -->
<attainGoal name="maven-multiproject-plugin:register"/>
<maven:set plugin="maven-multiproject-plugin"
property="maven.multiproject.includes"
value="${my.ejb.clients}"/>
<maven:set plugin="maven-multiproject-plugin"
property="goal"
value="ejb:deploy-client"/>
<attainGoal name="multiproject:goal"/>
<!-- call the nultiproject plugin again but with a different list -->
<maven:set plugin="maven-multiproject-plugin"
property="maven.multiproject.includes"
value="${my.ejb.clients.src}"/>
<maven:set plugin="maven-multiproject-plugin"
property="goal"
value="dist:deploy-src"/>
<attainGoal name="multiproject:goal"/>
</goal>
The first list will be used in the second call to the plugin since there is a flag in multiproject:projects-init
that prevents the goal being runned twice.

What I want to add is the possibillity to force the execution of multiproject:projects-init. For instance like this:
<goal name="release-ejb-client">
<!-- dummy call to init the plugin -->
<attainGoal name="maven-multiproject-plugin:register"/>
<maven:set plugin="maven-multiproject-plugin"
property="maven.multiproject.includes"
value="${my.ejb.clients}"/>
<maven:set plugin="maven-multiproject-plugin"
property="goal"
value="ejb:deploy-client"/>
<attainGoal name="multiproject:goal"/>
<!-- call the nultiproject plugin again but with a different list
Fist force the multiproject:projects-init to be executed.
-->
<maven:set plugin="maven-multiproject-plugin"
property="mpprojectsInit"
value="false"/>
<maven:set plugin="maven-multiproject-plugin"
property="maven.multiproject.includes"
value="${my.ejb.clients.src}"/>
<maven:set plugin="maven-multiproject-plugin"
property="goal"
value="dist:deploy-src"/>
<attainGoal name="multiproject:goal"/>
</goal>

The new multiproject:projects-init will look like this:
<goal name="multiproject:projects-init">
<j:if test="${mpprojectsInit == null || mpprojectsInit == false}">
<j:set var="mpprojectsInit" value="true" />
<ant:echo>Gathering project list</ant:echo>
<maven:reactor
basedir="${maven.multiproject.basedir}"
banner="Gathering project list"
includes="${maven.multiproject.includes}"
excludes="${maven.multiproject.excludes}"
postProcessing="true"
collectOnly="true"
collectionVar="multiprojects"
ignoreFailures="${maven.multiproject.ignoreFailures}"
/>
</j:if>
</goal>



Lucas Persson added a comment - 09/Sep/05 07:17 AM

Patch to fix the improvment.


Lucas Persson made changes - 09/Sep/05 07:17 AM
Field Original Value New Value
Attachment MPMULTIPROJECT-58.txt [ 16573 ]
Lukas Theussl made changes - 22/Nov/05 05:11 PM
Status Open [ 1 ] Closed [ 6 ]
Resolution Fixed [ 1 ]