I am running my tests on locally built maven master and it seems that dependencies/dependency/version node content like 1.0.0 is considered to be the single version range which is [1.0.0]. Shouldn't the same version format have the same interpretation throughout the pom? Now from my tests I can say parent/version value 1.0.0 produces VersionRange instance with Restriction.EVERYTHING.
Thanks -Denis On Thu, Sep 24, 2015 at 4:43 PM, Denis Golovin <[email protected]> wrote: > Stephen, > > I guess this is the regression issue you are talking about > https://issues.apache.org/jira/browse/MNG-5840. > > I've verified on master build and it still have the same behavior. It > works where it was not working in previous version up to 3.2.5. > I blame version ranges that now supported in parent/version (see > https://github.com/apache/maven/blob/master/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java#L929). > It creates VersionRange instance that recommends version from child1 pom > but not restricts upper and lover bounds. This means it is still ignoring > version in child pom and using whatever is in parent pom resolved from > local file system. > > To make it works the same way as in 3.2.x the explicit version range > should be used: > - [version] - to allow the only version; > - [version,) - to have open range; > > then example fails as expected. > > -Denis > > > On Thu, Sep 24, 2015 at 1:27 PM, Stephen Connolly < > [email protected]> wrote: > >> Regression filed and fixed... you are just waiting for the next >> release in the 3.3.x line >> >> On 24 September 2015 at 19:40, Denis Golovin <[email protected]> wrote: >> > I have simple project structure: >> > >> > test-module >> > |-pom.xml >> > |-child1 >> > |-pom.xml >> > >> > test-module/pom.xml >> > >> > <project >> > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >> > http://maven.apache.org/xsd/maven-4.0.0.xsd" >> > xmlns="http://maven.apache.org/POM/4.0.0" >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> >> > <modelVersion>4.0.0</modelVersion> >> > <groupId>org.name</groupId> >> > <artifactId>root</artifactId> >> > <version>1.0.0-SNAPSHOT</version> >> > <packaging>pom</packaging> >> > <modules> >> > <module>child1</module> >> > </modules> >> > </project> >> > >> > test-module/child1/pom.xml (note parent/version value) >> > >> > <project >> > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >> > http://maven.apache.org/xsd/maven-4.0.0.xsd" >> > xmlns="http://maven.apache.org/POM/4.0.0" >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> >> > <modelVersion>4.0.0</modelVersion> >> > <parent> >> > <groupId>org.name</groupId> >> > <artifactId>root</artifactId> >> > <version>anything</version> >> > </parent> >> > <groupId>org.name</groupId> >> > <artifactId>child1</artifactId> >> > <version>1.0.0-SNAPSHOT</version> >> > <packaging>pom</packaging> >> > </project> >> > >> > In maven 3.2.5 it fails with parent/pom.xml resolution error, but it >> works >> > in 3.3.x. In 3.3.x it seems just using parent pom.xml file available >> from >> > local file system and ignoring parent/version node value. >> > >> > Is that sort of regression or it was done on purpose? >> > >> > Thanks >> > >> > -Denis >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > > -- > Denis > -- Denis
