How to use an a12 artifact as a maven bom (Bill of materials)?

I’m trying to ease dependency management for <PROJECT_NAME>. Therefore I would like to use some a12 artifacts as boms (see Introduction to the Dependency Mechanism – Maven).

So I have a parent pom:

<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.mgmtp.cosmo.claims</groupId>
	<artifactId>a12-bom-usage</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>pom</packaging>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.mgmtp.a12.services</groupId>
				<artifactId>rest-client</artifactId>
				<version>24.1.1</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>
	
	<modules>
		<module>module-dependent-on-bom-dependency</module>
	</modules>
</project>

And the pom of the module:

<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>com.mgmtp.cosmo.claims</groupId>
		<artifactId>a12-bom-usage</artifactId>
		<version>0.0.1-SNAPSHOT</version>
	</parent>
	<artifactId>module-dependent-on-bom-dependency</artifactId>

	<dependencies>
		<dependency>
			<groupId>com.mgmtp.a12.services</groupId>
			<artifactId>client-api</artifactId>
		</dependency>
	</dependencies>

</project>

However when I invoke mvn validate I get the following build error:

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for com.mgmtp.a12.services:client-api:jar is missing. @ com.mgmtp.cosmo.claims:module-dependen-on-bom-dependency:[unknown-version], C:\Users\abrieg\workspaces\cosmo-claims\a12-bom-usage\module-dependent-on-bom-dependency\pom.xml, line 13, column 15
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.mgmtp.cosmo.claims:module-dependen-on-bom-dependency:0.0.1-SNAPSHOT (C:\Users\abrieg\workspaces\cosmo-claims\a12-bom-usage\module-dependent-on-bom-dependency\pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for com.mgmtp.a12.services:client-api:jar is missing. @ com.mgmtp.cosmo.claims:module-dependen-on-bom-dependency:[unknown-version], C:\Users\abrieg\workspaces\cosmo-claims\a12-bom-usage\module-dependent-on-bom-dependency\pom.xml, line 13, column 15
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

I expected that client-api would be available as a managed dependency since it is imported from rest-client.

Am I doing something wrong or is there a problem with the rest-client pom that is downloaded from artifactory?

Hi @andreas-fresh-mesa few tickets already trigger by this and need to be processed within A12. I will keep you up to date. Thanks.

The problem is that rest-client doesn’t define a dependencyManagement, but just uses a dependencies section in it’s pom. But only dependencies from a dependencyManagement section can be import via a bom.

This is the ticket that will track progress <INTERNAL_LINK>