versions icon indicating copy to clipboard operation
versions copied to clipboard

parent profile dependency property is not associated

Open ggkochanski opened this issue 1 year ago • 1 comments

Profile dependency property, e.g.

<?xml version="1.0" encoding="UTF-8"?>
<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>com.acme</groupId>
	<artifactId>my-artifact-parent</artifactId>
	<version>1.0</version>
	<packaging>pom</packaging>

	<properties>
		<maven-dependency-plugin.version>3.6.0</maven-dependency-plugin.version>
	</properties>

	<dependencies>
	</dependencies>

	<profiles>
		<profile>
			<id>profile1</id>
			<dependencies>
				<dependency>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-dependency-plugin</artifactId>
					<version>${maven-dependency-plugin.version}</version>
				</dependency>
			</dependencies>
		</profile>
	</profiles>
</project>

is normally updated by command:

$ mvn -Pprofile1 org.codehaus.mojo:versions-maven-plugin:2.16.2:update-properties

[INFO] --- versions:2.16.2:update-properties (default-cli) @ my-artifact-parent ---
[INFO] Updated ${maven-dependency-plugin.version} from 3.6.0 to 3.6.1

But running this command on a child project, e.g.

<?xml version="1.0" encoding="UTF-8"?>
<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>com.acme</groupId>
	<artifactId>my-artifact-child</artifactId>
	<version>1.0</version>
	<packaging>pom</packaging>

	<parent>
		<groupId>com.acme</groupId>
		<artifactId>my-artifact-parent</artifactId>
		<version>1.0</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<properties>
		<maven-dependency-plugin.version>3.6.0</maven-dependency-plugin.version>
	</properties>
</project>

does not update the property.

The expected behavior is that activating parent profile should allow to update properties of those dependencies

ggkochanski avatar Jun 04 '24 08:06 ggkochanski

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Jun 05 '25 02:06 github-actions[bot]