I see one clarification to add to your "by value" explanation: what is imported is the dependencyManagement content from the *effective* imported model, ie with its interpolation (properties substitution) already done
I don't see how any property from the imported model could affect the importing model A few reference to source code: - the importer: https://maven.apache.org/ref/3.8.6/maven-model-builder/xref/org/apache/maven/model/composition/DefaultDependencyManagementImporter.html - and the effective model resolution that happens before: https://maven.apache.org/ref/3.8.6/maven-model-builder/xref/org/apache/maven/model/building/DefaultModelBuilder.html#L1236 Hope this helps Hervé On 2022/08/17 21:47:41 Laird Nelson wrote: > I have been using Maven for decades. > > I have a question about import scope. > > My mental model of this feature has always been the following: > > Suppose my project has: > > <dependencyManagement> > <dependencies> > <dependency> > <!-- coordinates --> > <type>*pom*</type> > <scope>*import*</scope> > </dependency> > </dependencies> > </dependencyManagement> > > My understanding is that the imported pom's <dependencyManagement> element > is effectively "copied over" this dependency "by value" and then the > resulting pom is interpreted afterward. > > Now consider an imported pom that defines a <properties> element. (Ideally > it shouldn't but consider one just the same.) > > I am seeing a situation that I don't understand. I am importing a pom as > above, and its property definition is somehow affecting my importing pom. > That is, property references in my pom ${likeThis} are being affected by > the imported pom's value for the likeThis property. > > I didn't think that anything other than the <dependencyManagement> element > was relevant during an import. > > Obviously my mental model of how importing works is broken. What am I > missing? What other parts of the imported pom are there that can affect my > pom? I didn't find any information on this in the Maven documentation. > > Thanks, > Best, > Laird > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org