Maven
  1. Maven
  2. MNG-3530

Regression: Properties get resolved before the LifeCycle is Forked.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.9
    • Fix Version/s: 2.1.0-M1
    • Component/s: General
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      2

      Description

      Since Maven 2.0.9 – If a plugin uses a forked lifecycle, then the project properties are resolved by maven before the lifecycle is forked.
      This means that the forked lifecycle has the non-forked lifecycle's values.

      This was not the case in maven prior to version 2.0.9, where properties were resolved at a much later time.

      For example - the attached sample project uses the Clover plugin with the xdoclet plugin. When

      mvn clean install

      is run under Maven-2.0.8 you can see the following output:

      [INFO] [xdoclet:xdoclet {execution: default}]
      [INFO] Initializing DocletTasks!!!
      [INFO] Executing tasks
           [echo] Build Dir: ${project.build.directory}/test.clover
      [INFO] Executed tasks
      

      whilst Maven 2.0.9 outputs:

      [INFO] [xdoclet:xdoclet {execution: default}]
      [INFO] Initializing DocletTasks!!!
      [INFO] Executing tasks
          [mkdir] Created dir: /Users/niick/work/mvnclvr/src/it/mng/xdoclet/target
          [touch] Creating /Users/niick/work/mvnclvr/src/it/mng/xdoclet/target/test.clover
           [echo] Build Dir: /Users/niick/work/mvnclvr/src/it/mng/xdoclet/target/test.clover
      [INFO] Executed tasks
      [INFO] [resources:resources]
      

      The fact the $

      {project.build.directory}

      property has been expanded already under 2.0.9, means that the forked lifecycle has the same value for that property.

      This new behavior will break any plugin which uses a forked lifecycle.

        Issue Links

          Activity

          Hide
          John Casey added a comment -

          Consolidating to 2.1.0-M1 so we can then rename to 2.1.0. We can weed out any issues we want to push to a later release from this set once we've done the consolidation.

          Show
          John Casey added a comment - Consolidating to 2.1.0-M1 so we can then rename to 2.1.0. We can weed out any issues we want to push to a later release from this set once we've done the consolidation.
          Hide
          Brett Porter added a comment -

          I'm still getting this with 2.1.0-M1 and M2-SNAPSHOT. Are we all using the same versions of the plugins?

          Show
          Brett Porter added a comment - I'm still getting this with 2.1.0-M1 and M2-SNAPSHOT. Are we all using the same versions of the plugins?
          Hide
          Benjamin Bentmann added a comment -

          Are we all using the same versions of the plugins?

          The attached test project is missing plugin versions, that should be fixed to wipe out this uncertainty.

          Show
          Benjamin Bentmann added a comment - Are we all using the same versions of the plugins? The attached test project is missing plugin versions, that should be fixed to wipe out this uncertainty.
          Hide
          Brett Porter added a comment -

          I think I made the same mistake I may have made earlier - running "mvn clean install" from the first instructions with the second project. It works if I run the clover instrument command per the latter instructions.

          Show
          Brett Porter added a comment - I think I made the same mistake I may have made earlier - running "mvn clean install" from the first instructions with the second project. It works if I run the clover instrument command per the latter instructions.
          Hide
          Nick Pellow added a comment -

          ah. sorry for the confusion here. I think I tried removing the Clover plugin entirely from the equation, however left the check in the verifications.xml .

          Cheers,Nick

          Show
          Nick Pellow added a comment - ah. sorry for the confusion here. I think I tried removing the Clover plugin entirely from the equation, however left the check in the verifications.xml . Cheers,Nick

            People

            • Assignee:
              John Casey
              Reporter:
              Nick Pellow
            • Votes:
              8 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: