Closed Nomad95 closed 4 months ago
Hi. Strangely, I'm unable to reproduce this with 2.13.0, 2.14.2, latest snapshot, or even with 2.15.0. I'm using the following test case:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>localhost</groupId>
<artifactId>it-use-next-releases-props</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>dummy-api</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
</project>
invoker.properties:
invoker.goals = ${project.groupId}:${project.artifactId}:2.15.0:use-latest-releases
verify.groovy:
import groovy.xml.XmlSlurper
def project = new XmlSlurper().parse( new File( basedir, 'pom.xml' ) )
assert project.dependencies.dependency.version == '3.0'
Properties are being resolved using the use-latest-releases
goal and we can see the dependency bumped to 3.0.
(Removing the edited section since I wasn't using invoker.mavenOpts properly. Still cannot reproduce even with -U passed to maven).
Also didn't manage to reproduce it when the project was using a property from parent:
parent-pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>default-group</groupId>
<artifactId>parent-artifact</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<properties>
<group>localhost</group>
</properties>
</project>
pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>default-group</groupId>
<artifactId>parent-artifact</artifactId>
<version>1.0.0</version>
<relativePath>parent-pom.xml</relativePath>
</parent>
<groupId>localhost</groupId>
<artifactId>it-use-next-releases-props</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>${group}</groupId>
<artifactId>dummy-api</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
</project>
All the same, the dependency is being bumped to the latest release...
Hi,
in version 2.15.0 plugin does not resolve properties from parent anymore
Example dependency in
dependencyManagement
root POM:Command i am using:
Plugin is not updating dependencies that have
${project.groupId}
property in groupId tag, even though it resolves to "my.project.id". It doesn't work for Either snapshot nor release versions. I was using 2.13.0 earlier and it was working properly.