Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parent profile dependency property is not associated #1085

Open
ggkochanski opened this issue Jun 4, 2024 · 0 comments
Open

parent profile dependency property is not associated #1085

ggkochanski opened this issue Jun 4, 2024 · 0 comments

Comments

@ggkochanski
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant