Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-4237

also-make-dependents builds parent projects incorrectly

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.1.0
    • None
    • Reactor and Workspace
    • None

    Description

      I am attempting to use --also-make-dependents to build a minimal set of changed components in response to source code changes.

      Here is a sample project tree:

      • root (1.0.0)
        • p1 (1.0.0)
          • c1 (1.0.1-SNAPSHOT)
        • p2 (1.0.1-SNAPSHOT) (depends on c1)
        • p3 (1.0.0)
          • c2 (1.0.0)

      A developer adds a new project c3 under p3, modifies p3 to include c3, and modifies c1 so that it depends on c3. The version numbers of all modified projects are updated to 1.0.1-SNAPSHOT. The resulting project tree would appear as follows (with the modified projects in bold):

      • root (1.0.0)
        • p1 (1.0.0)
          • c1 (1.0.1-SNAPSHOT) (depends on c3)
        • p2 (1.0.1-SNAPSHOT) (depends on c1)
        • p3 (1.0.1-SNAPSHOT)
          • c2 (1.0.0)
          • c3 (1.0.1-SNAPSHOT)

      After the developer checks in these changes, the continuous integration server detects the changes and runs mvn --projects p1/c1,p3,p3/c3 --also-make-dependents deploy. The expected result of the reactor would be:

      • p3 is deployed
      • c3 is deployed
      • c1 is deployed
      • p2 is deployed

      However when the command is run c2 is also built. c2 is not a dependent on any of the modified projects and should not be built. I assume it is being built because its parent is being built, but this should not happen.

      If c2 declared p3:1.0.1-SNAPSHOT as its parent it should be rebuilt because a change in the parent could affect the child. However c2 is a child module of p3:1.0.0 so a new version of p3 should not affect it.

      Also, if the root project is modified another problem emerges. Attempting to add a period (to reference the current working directory) to the project list causes the build to fail:

      mvn --projects . --also-make-dependents
      
      [INFO] Scanning for projects...
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Couldn't find specified project in module list: C:\root\.
      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 1 second
      [INFO] Finished at: Fri Jul 10 14:48:00 CDT 2009
      [INFO] Final Memory: 5M/9M
      [INFO] ------------------------------------------------------------------------
      

      Attachments

        1. root.zip
          5 kB

        Issue Links

          Activity

            People

              bentmann Benjamin Bentmann
              joshbeitelspacher Josh Beitelspacher
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: