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

Dependency Management in profiles is not injected when imported from BOM #320

Closed
Syquel opened this issue Oct 12, 2022 · 0 comments · Fixed by #321
Closed

Dependency Management in profiles is not injected when imported from BOM #320

Syquel opened this issue Oct 12, 2022 · 0 comments · Fixed by #321

Comments

@Syquel
Copy link
Contributor

Syquel commented Oct 12, 2022

Description

In case a BOM is being imported, which contains a profile with a dependencyManagement section, this section is not being injected into the Maven build when flatten-maven-plugin is used and the plugin fails to create the effective POM model.

Example

The BOM org.infinispan:infinispan-bom:13.0.11.Final defines a subset of its dependency management in a separate profile, which is activated by default:

[...]
<profile>
	<id>community-release</id>
	<activation>
		<activeByDefault>true</activeByDefault>
	</activation>
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.infinispan</groupId>
				<artifactId>infinispan-marshaller-kryo</artifactId>
				<version>${version.infinispan}</version>
			</dependency>
			<dependency>
				<groupId>org.infinispan</groupId>
				<artifactId>infinispan-marshaller-kryo-bundle</artifactId>
				<version>${version.infinispan}</version>
			</dependency>
			<dependency>
				<groupId>org.infinispan</groupId>
				<artifactId>infinispan-marshaller-protostuff</artifactId>
				<version>${version.infinispan}</version>
			</dependency>
			<dependency>
				<groupId>org.infinispan</groupId>
				<artifactId>infinispan-marshaller-protostuff-bundle</artifactId>
				<version>${version.infinispan}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>
</profile>
[...]

In case a Maven project imports this BOM and declares a dependency on one of these managed dependencies the flatten-maven-plugin fails to build the effective POM model.
Error message: [ERROR] 'dependencies.dependency.version' for org.infinispan:infinispan-marshaller-kryo:jar is missing.

Example project POM:

[...]
<dependencyManagement>
	<dependencies>
		<!-- This BOM contains a profile 'community-release' which is activated by default -->
		<!-- This profile provides dependency management for the artifact 'org.infinispan:infinispan-marshaller-kryo' -->
		<dependency>
			<groupId>org.infinispan</groupId>
			<artifactId>infinispan-bom</artifactId>
			<version>13.0.11.Final</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

<dependencies>
	<dependency>
		<groupId>org.infinispan</groupId>
		<artifactId>infinispan-marshaller-kryo</artifactId>
	</dependency>
</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

Successfully merging a pull request may close this issue.

1 participant