Details

    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      Add a commandline option to enable maven to expand the reactor scope to find projects that are dependencies
      of the projects currently in the reactor, and add them.

      Currently only the current project and child projects are included in the reactor search. I'm proposing
      to add a commandline switch that lets maven check parent directories to find the root of the project tree,
      and then do a normal reactor scan, only adding projects that would normally not be added if they're needed
      as dependencies of the projects that would normally be built.

      Here's a sample project tree:

      • root
        • p1
          • c1 (depends on p2)
        • p2 (depends on c2)
        • p3
          • c2

      And a sample algorithm:

      • When building c1, the reactor would contain [c1].
      • Maven would check p1, then root, etc, using the <parent> tags (without the versions!)
        to see if the project is still in the current reactor.
      • It would then create a second list of projects (reactor2) containing ALL projects, using the newly discovered root: [root, p1, c2, p2].
      • remove all projects from reactor2 contained in reactor: reactor2 = [root, p1, p2]
      • resolve all direct dependencies for all projects in reactor in reactor2 and add them to reactor, taking versions into account: reactor = [p2, c1]
      • repeat previous step until all projects have their dependencies resolved from reactor 2. first iteration would yield reactor = [c2, p2, c1],
        next iteration would stop since c1 doesn't have any dependencies present in reactor2.

      This would ensure that when some local project's sources have changed, they'll be incorporated
      in the build, regardless of where you build. So you don't have to do a reactor build each time you change more
      than 1 project, and you don't have to remember which projects you changed and build them in the correct order
      yourself, manually.

        Issue Links

          Activity

          Kenney Westerhof made changes -
          Field Original Value New Value
          Description Add a commandline option to enable maven to expand the reactor scope to find projects that are dependencies
          of the projects currently in the reactor, and add them.

          Currently only the current project and child projects are included in the reactor search. I'm proposing
          to add a commandline switch that lets maven check parent directories to find the root of the project tree,
          and then do a normal reactor scan, only adding projects that would normally not be added if they're needed
          as dependencies of the projects that would normally be built.

          Here's a sample project tree:

          * root
          ** p1
          *** c1 (depends on p2)
          ** p2

          And a sample algorithm:

          - When building c1, the reactor would contain [c1].

          - Maven would check p1, then root, etc, using the <parent> tags (without the versions!)
            to see if the project is still in the current reactor.

          - It would then create a second list of projects (reactor2) containing ALL projects: [root, p1, c2, p2].

          - remove all projects from reactor2 contained in reactor: reactor2 = [root, p1, p2]

          - remove all projects from reactor2 that are NOT (transitive) dependencies of reactor, taking versions into account: reactor2 = [p2]

          - merge reactor2 and reactor: [c1, p2]

          - apply reactor sort and build.

          This would ensure that when some local project's sources have changed, they'll be incorporated
          in the build, regardless of where you build. So you don't have to do a reactor build each time you change more
          than 1 project, and you don't have to remember which projects you changed and build them in the correct order
          yourself, manually.
          Add a commandline option to enable maven to expand the reactor scope to find projects that are dependencies
          of the projects currently in the reactor, and add them.

          Currently only the current project and child projects are included in the reactor search. I'm proposing
          to add a commandline switch that lets maven check parent directories to find the root of the project tree,
          and then do a normal reactor scan, only adding projects that would normally not be added if they're needed
          as dependencies of the projects that would normally be built.

          Here's a sample project tree:

          * root
          ** p1
          *** c1 (depends on p2)
          ** p2 (depends on c2)
          ** p3
          *** c2

          And a sample algorithm:

          - When building c1, the reactor would contain [c1].

          - Maven would check p1, then root, etc, using the <parent> tags (without the versions!)
            to see if the project is still in the current reactor.

          - It would then create a second list of projects (reactor2) containing ALL projects, using the newly discovered root: [root, p1, c2, p2].

          - remove all projects from reactor2 contained in reactor: reactor2 = [root, p1, p2]

          - resolve all direct dependencies for all projects in reactor in reactor2 and add them to reactor, taking versions into account: reactor = [p2, c1]

          - repeat previous step until all projects have their dependencies resolved from reactor 2. first iteration would yield reactor = [c2, p2, c1],
            next iteration would stop since c1 doesn't have any dependencies present in reactor2.

          This would ensure that when some local project's sources have changed, they'll be incorporated
          in the build, regardless of where you build. So you don't have to do a reactor build each time you change more
          than 1 project, and you don't have to remember which projects you changed and build them in the correct order
          yourself, manually.
          Jason van Zyl made changes -
          Fix Version/s Reviewed [ 13555 ]
          brianfox brianfox made changes -
          Link This issue is related to MNG-1694 [ MNG-1694 ]
          brianfox brianfox made changes -
          Link This issue is duplicated by MNG-2366 [ MNG-2366 ]
          brianfox brianfox made changes -
          Link This issue is duplicated by MNG-3377 [ MNG-3377 ]
          Dan Fabulich made changes -
          Priority Minor [ 4 ] Major [ 3 ]
          Summary Add option to find root of project tree from subproject and build required deps Make Like Reactor Mode
          Dan Fabulich made changes -
          Fix Version/s 2.1.0 [ 14503 ]
          Fix Version/s Reviewed Pending Version Assignment [ 13555 ]
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Dan Fabulich made changes -
          Assignee Dan Fabulich [ dfabulich ]
          Brett Porter made changes -
          Link This issue is duplicated by MNG-4108 [ MNG-4108 ]
          Benjamin Bentmann made changes -
          Fix Version/s 2.1.0 [ 14587 ]
          Benjamin Bentmann made changes -
          Fix Version/s 2.1.0-M1 [ 14503 ]
          Benjamin Bentmann made changes -
          Link This issue relates to MNG-4244 [ MNG-4244 ]
          Benjamin Bentmann made changes -
          Link This issue relates to MNG-4260 [ MNG-4260 ]
          Benjamin Bentmann made changes -
          Link This issue relates to MNG-4324 [ MNG-4324 ]

            People

            • Assignee:
              Dan Fabulich
              Reporter:
              Kenney Westerhof
            • Votes:
              5 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: