I am building a project that runs on top of Wildfly 14.0.1-Final.
I wanted to try the BOM feature of maven, so I thought: "I will add the wildfly 14 BOM to the dependency management of my parent POM, and then I will only need to define the groupId and artifactId of each artifact, without caring about version number/scope".
So, in my parent POM, I did add:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.wildfly.bom</groupId>
<artifactId>wildfly</artifactId>
<version>14.0.1.Final</version>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
and to my children POM, I did add a reference to the CDI API:
<dependencies>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
</dependency>
</dependencies>
Yet maven protests that it does not have the version for cdi-api.
The error is:
ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] 'dependencies.dependency.version' for javax.enterprise:cdi-api:jar is missing. @ line 29, column 15 @
I have also tried with the wildfly-javaee8
BOM artifact.
What am I missing/missunderstanding?
@JamesR.Perkins comment made me realize that I did not have setup the import scope for the POM. Also, the correct artifact is org.wildfly.bom:wildfly-javaee8
James was right in that I need to define the scope as provided when I needed to use the dependency, otherwise it cdi-api.jar would end packaged in the ear and this could cause problems.