Maven 1.x Multi-Project Plugin
  1. Maven 1.x Multi-Project Plugin
  2. MPMULTIPROJECT-58

Possibllity to re-execute multiproject:projects-init

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: 1.5
    • Labels:
      None
    • Environment:
      windowsXP
    • Number of attachments :
      1

      Description

      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>

        Activity

        Hide
        Lucas Persson added a comment -

        Patch to fix the improvment.

        Show
        Lucas Persson added a comment - Patch to fix the improvment.

          People

          • Assignee:
            Unassigned
            Reporter:
            Lucas Persson
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: