Maven
  1. Maven
  2. MNG-1649

Allow plugins to depend upon other plugin's goals

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

        Activity

        Hide
        Ole Ersoy added a comment -

        Hi,

        I've been reading through all the maven 2 documentation to understand how I can:
        Use Case A) Define a new archetype and give it's own lifecycle.
        Use Case B) Redefine the lifecycle of a current archetype

        Before I started I tried to think of the simplest way to do this, so I had a reference point for how it is currently being done.

        Here's an example of what I think would be the simplest way to do use case A:

        • Then add to the pom something like this:
          <Routing-Sequences>
          <Sequence id="1">
          <goal name="p1:g1">
          </goal>
          <goal name="p2:g1">
          </goal>
          <goal name="p3:g1">
          </goal>
          <goal name="p4:g1">
          </goal>
          </Sequence>
          <Sequence id="2">
          <goal name="p1:g1">
          </goal>
          <goal name="p4:g1">
          </goal>
          <goal name="p3:g1">
          </goal>
          <goal name="p5:g1">
          </goal>
          </Sequence>
          </Routing-Sequences>

        This would let maven know how to process the files given by an archetype instance.

        In this case the sequences are mutually exclusive. So they can be performed in paralell if need be. The order in which the plugin goals are executed is the order in which they are given.

        Now if I needed to do Use Case B I would just put something like this in the POM
        for that archetype instance:
        <Sequence>
        <goal name="px:g1" sequence="1" depends="p2:g1">
        </Sequence>

        This lets maven know that it needs to perform goal g1 of plugin px after goal g1 of plugin p2 of sequence 1.

        Now since Maven executes phases in the lifecycle,
        lifecycle metadata could be bound to each <goal> element within each sequence, and
        the user could just do
        mvn sequence1:deploy ...

        Obviously the sequence would need to be specified if there are multiple sequences.

        Any thoughts?

        Thanks,

        • Ole
        Show
        Ole Ersoy added a comment - Hi, I've been reading through all the maven 2 documentation to understand how I can: Use Case A) Define a new archetype and give it's own lifecycle. Use Case B) Redefine the lifecycle of a current archetype Before I started I tried to think of the simplest way to do this, so I had a reference point for how it is currently being done. Here's an example of what I think would be the simplest way to do use case A: Define the archetype just as specified in the guide to creating archetypes http://maven.apache.org/guides/mini/guide-creating-archetypes.html Then add to the pom something like this: <Routing-Sequences> <Sequence id="1"> <goal name="p1:g1"> </goal> <goal name="p2:g1"> </goal> <goal name="p3:g1"> </goal> <goal name="p4:g1"> </goal> </Sequence> <Sequence id="2"> <goal name="p1:g1"> </goal> <goal name="p4:g1"> </goal> <goal name="p3:g1"> </goal> <goal name="p5:g1"> </goal> </Sequence> </Routing-Sequences> This would let maven know how to process the files given by an archetype instance. In this case the sequences are mutually exclusive. So they can be performed in paralell if need be. The order in which the plugin goals are executed is the order in which they are given. Now if I needed to do Use Case B I would just put something like this in the POM for that archetype instance: <Sequence> <goal name="px:g1" sequence="1" depends="p2:g1"> </Sequence> This lets maven know that it needs to perform goal g1 of plugin px after goal g1 of plugin p2 of sequence 1. Now since Maven executes phases in the lifecycle, lifecycle metadata could be bound to each <goal> element within each sequence, and the user could just do mvn sequence1:deploy ... Obviously the sequence would need to be specified if there are multiple sequences. Any thoughts? Thanks, Ole
        Hide
        Brett Porter added a comment -

        Mark - want to do a proposal for this one?

        Show
        Brett Porter added a comment - Mark - want to do a proposal for this one?
        Hide
        Jason van Zyl added a comment -

        Plugins depending on plugins is just a bad idea.

        Show
        Jason van Zyl added a comment - Plugins depending on plugins is just a bad idea.

          People

          • Assignee:
            Unassigned
            Reporter:
            Mark Hobson
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: