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

DefaultMavenProjectBuilder caches wrong version of Models, prior to interpolation or managed dependency injection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0-alpha-1
    • Plugins and Lifecycle
    • None
    • all

    Description

      From the email I sent to the m2-dev list detailing this problem:

      I just uncovered a problem which is surely present in the current binary bundles of m2. It has to do with projects that depend on poms which utilize interpolation or managed dependencies...

      When such a project exists, the first plugin that resolves dependencies will retrieve the correct and complete POM for each dependency, with interpolation and managed deps included. HOWEVER, this first resolution process will result in the models being incorrectly cached in the project builder (cached before they are interpolated or have defaults injected), which means that each subsequent plugin that uses a cached model which utilizes these features will get a "raw" version of the model; that is, with none of these higher-level features included.

      As an interim solution, I have disabled cached-model retrieval from the MavenMetadataSource. While this may slow m2 down a bit (since it will have to build the models every time), it will at least provide correct results until we have the time to address this error properly.

      ALSO: this is well documented in the code itself (MavenMetadataSource, DefaultMavenProjectBuilder).

      Attachments

        Activity

          People

            brett Brett Porter
            jdcasey John Dennis Casey
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4h
                4h
                Remaining:
                Remaining Estimate - 4h
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified