jmax01 commented on a change in pull request #422:
URL: https://github.com/apache/maven/pull/422#discussion_r549891345



##########
File path: 
maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
##########
@@ -1200,7 +1200,7 @@ public ModelSource getModelSource()
                 }
                 else
                 {
-                    if ( childModel.getVersion().contains( "${" ) )
+                    if ( childModel.getVersion().contains( 
"${project.version}" ) )

Review comment:
       Update:  So the funny thing is the thing we are trying to avoid by 
checking the version for property replacement *doesn't* work with the most 
likely case one would see in the wild (which is why I *can't* get the test to 
throw properly).
   
   When the test is actually executed with the below pom the 
`childModel.getVersion()` returns `1` not `${project.version}`!
   
   ```
   <project>
     <modelVersion>4.0.0</modelVersion>
     <parent>
       <groupId>org.apache</groupId>
       <artifactId>apache</artifactId>
       <version>[1,1]</version>
     </parent>
     <artifactId>child</artifactId>
     <!-- Must not be project.version from parent due to version range. -->
     <version>${project.version}</version>
     <packaging>pom</packaging>
   </project>
   
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to