Maven
  1. Maven
  2. MNG-3284

Cached plugins are used, even when the specifically declared

    Details

      Description

      In the attached project, you can build module A, then build module B, but the top level aggregator project will fail at B.

      The reason this happens is that maven seems to cache plugins. When B is built in isolation, all things are fine - but when built in aggregation, one of the plugins that it uses has already been instantiated, and so it uses that one. This is incorrect, since the declared version is different in B, and is relying on functionality not present in the version declared in A.

      I have seen similar behaviour when a plugin relies on other plugins to get work done - all of a sudden a build mysteriously stops working, because of a completely unrelated plugin.

      This is pretty painful because

      • it's possible to get into a 'no solution', where one project relies on one behaviour so can't upgrade, and one project relies on new behaviour, so can't downgrade.
      • you get builds that work OK in isolation, but not in their project. This is bad. Also builds tied together in bigger aggregator projects can fail in mysterious ways (mysterious because the user /has/ specified the plugin version, and maven has ignored them, or it's a plugin dependency that got there first)
      • subtle build ordering changes can cause new failures (the example has B depend on A - but the bug might only manifest itself in certain build orders that change even when B and A don't).
      1. 0001-Initial-fix-to-see-if-we-can-have-1-version-of-a-pl.patch
        14 kB
        nigel magnay
      2. 0001-Initial-fix-to-see-if-we-can-have-1-version-of-a-pl.patch.svn
        14 kB
        nigel magnay
      3. maven-bug-2.tar
        40 kB
        nigel magnay
      4. MNG-3284.patch
        14 kB
        Brian Fox
      5. mng3284-usingCachedPlugins.tar
        50 kB
        nigel magnay
      6. plugin.diff
        14 kB
        nigel magnay
      7. pluginbug.tar
        10 kB
        nigel magnay

        Issue Links

          Activity

          nigel magnay created issue -
          nigel magnay made changes -
          Field Original Value New Value
          Link This issue is related to MNG-3217 [ MNG-3217 ]
          nigel magnay made changes -
          Link This issue depends upon MNG-1024 [ MNG-1024 ]
          nigel magnay made changes -
          Link This issue depends upon MNG-1024 [ MNG-1024 ]
          nigel magnay made changes -
          Link This issue is related to MNG-1024 [ MNG-1024 ]
          nigel magnay made changes -
          Link This issue is related to MNG-3013 [ MNG-3013 ]
          nigel magnay made changes -
          Attachment maven-bug-2.tar [ 32065 ]
          nigel magnay made changes -
          Attachment 0001-Initial-fix-to-see-if-we-can-have-1-version-of-a-pl.patch [ 32066 ]
          nigel magnay made changes -
          Attachment mng3284-usingCachedPlugins.tar [ 33085 ]
          Brian Fox made changes -
          Fix Version/s 2.0.9 [ 13801 ]
          Brian Fox made changes -
          Assignee Brian Fox [ brianfox ]
          nigel magnay made changes -
          Attachment 0001-Initial-fix-to-see-if-we-can-have-1-version-of-a-pl.patch.svn [ 33113 ]
          Brian Fox made changes -
          Attachment MNG-3284.patch [ 33117 ]
          nigel magnay made changes -
          Attachment plugin.diff [ 33134 ]
          John Casey made changes -
          Assignee Brian Fox [ brianfox ] John Casey [ jdcasey ]
          John Casey made changes -
          Link This issue is related to MNG-1323 [ MNG-1323 ]
          John Casey made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          Brian Fox made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          John Casey made changes -
          Fix Version/s 2.0.9 [ 13801 ]
          Fix Version/s 2.0.10 [ 14112 ]
          John Casey made changes -
          Fix Version/s 2.0.10 [ 14112 ]
          Fix Version/s 2.0.11 [ 14118 ]
          Benjamin Bentmann made changes -
          Link This issue is related to MNG-3801 [ MNG-3801 ]
          Benjamin Bentmann made changes -
          Fix Version/s 3.0-alpha-1 [ 13143 ]
          Fix Version/s 2.0.11 [ 14118 ]
          Assignee John Casey [ jdcasey ] Benjamin Bentmann [ bentmann ]
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Closed [ 6 ]
          Fix Version/s 2.1.0 [ 14587 ]
          Benjamin Bentmann made changes -
          Link This issue relates to MSHITTY-10 [ MSHITTY-10 ]
          Benjamin Bentmann made changes -
          Link This issue relates to MOJO-641 [ MOJO-641 ]
          Clovis made changes -
          Link This issue relates to MNG-4580 [ MNG-4580 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 08:49:45 UTC 2015 [ 1428223785911 ]
          Mark Thomas made changes -
          Workflow jira [ 12713735 ] Default workflow, editable Closed status [ 12752960 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 21:45:26 UTC 2015 [ 1428270326204 ]
          Mark Thomas made changes -
          Workflow jira [ 12950093 ] Default workflow, editable Closed status [ 12986299 ]

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              nigel magnay
            • Votes:
              8 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development