Maven
  1. Maven
  2. MNG-2546

Allow plugin executions in the "super-init" phase before reactor sorting of modules build order

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 3.0-alpha-6
    • Component/s: Reactor and workspace
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      1

      Description

      As seen here, http://www.nabble.com/How-to-execute-a-plugin-prior-to-the-reactor-sorting--tf2062739.html#a5682349. I also have the need to bind my maven-pde-plugin to a phase before the reactor sorting of project build order happens. My plugin is being developed to build eclipse plugins, features, fragments, update sites and products. Right now I can build plugins and features. However the order has to constantly be managed by the user taking information from the eclipse descriptors and adding it to the pom file. For plugin projects I can bind to a phase before the compile phase and dynamically analyze the eclipse plugin descriptors and add the necessary dependencies/resources to the MavenProject instance and all is well. For feature projects, I also can dynamically analyze the eclipse feature descriptor and add the necessary resources to the MavenProject instance. However, features depend on other plugins, fragments and features. While I can dynamicaly add the plugins, fragments and features to the MavenProject as dependencies they are not taken into context as the reactor has already computed the sorting order.

      What would be perfect is if there was a "super-init" phase that plugins could bind to and be executed in before the normal declared lifecycle happened. Therefore no matter what the lifecycle was, the "super-init" phase would be available. Then plugins could do things like augmenting the super-pom with build #'s/identifiers, dependencies, dynamic projects, etc all before maven gets going. That would solve the problem myself and others have as well as be 100% backwards compatible. This super-init phase (please pick a better name) would e available to reactor and non-reactor builds. A more specific fix would be to allow plugins to ask the reactor to reevaluate the build order.

        Activity

        Hide
        Binyan added a comment -

        No, but I will now. Thnx.

        Show
        Binyan added a comment - No, but I will now. Thnx.
        Hide
        Jason van Zyl added a comment -

        It's probably the most comprehensive and Tom has been using it in production for quite some time. We have talked about reading manifests directly and it embeds the PDE resolver so it's not just a PDE wrapper. That approach still works and there is the PDE plugin and the PST work:

        http://svn.codehaus.org/m2eclipse/maven-pst/

        Show
        Jason van Zyl added a comment - It's probably the most comprehensive and Tom has been using it in production for quite some time. We have talked about reading manifests directly and it embeds the PDE resolver so it's not just a PDE wrapper. That approach still works and there is the PDE plugin and the PST work: http://svn.codehaus.org/m2eclipse/maven-pst/
        Hide
        Binyan added a comment -

        If I understand the last sentence, then you're saying that we have have 3 separate initiatives going on with Tom's work the PST plug-in (which I'm reading about now) and the PDE plug-in I worked up. If I got that wrong then please correct. I have some work similar to the PST stuff as I created mojos to handle an eclipse target platform and put it into a maven repo too. I started looking at Tom's work before I headed to the office and I'll pick back up after lunch today and after I finish the article on the PST mojos. I'm pretty sure Tom's ahead of me and would welcome the chance to work with him to solve this generic OSGi bundle building problem.

        Show
        Binyan added a comment - If I understand the last sentence, then you're saying that we have have 3 separate initiatives going on with Tom's work the PST plug-in (which I'm reading about now) and the PDE plug-in I worked up. If I got that wrong then please correct. I have some work similar to the PST stuff as I created mojos to handle an eclipse target platform and put it into a maven repo too. I started looking at Tom's work before I headed to the office and I'll pick back up after lunch today and after I finish the article on the PST mojos. I'm pretty sure Tom's ahead of me and would welcome the chance to work with him to solve this generic OSGi bundle building problem.
        Hide
        Brett Porter added a comment -

        this was recently discussed again on Maven dev for a different use case

        Show
        Brett Porter added a comment - this was recently discussed again on Maven dev for a different use case
        Hide
        Jason van Zyl added a comment -

        You can now access the extension points before and after the build is executed in 3.x. We use this exactly for OSGi as you were trying with the PDE plugin.

        Show
        Jason van Zyl added a comment - You can now access the extension points before and after the build is executed in 3.x. We use this exactly for OSGi as you were trying with the PDE plugin.

          People

          • Assignee:
            Jason van Zyl
            Reporter:
            Binyan
          • Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: