14

I'm working on a project to deploy to Wildfly, and I'm using Maven to build it. This is a complex project with multiple war/jar/ear files, so there's a parent pom.xml with the following in it:

...
<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.wildfly.bom</groupId>
      <artifactId>jboss-javaee-7.0-with-all</artifactId>
      <version>8.1.0.Final</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
...
  </dependencies>
</dependencyManagement>
...

Unfortunately, the above BOM does not include various jar files that I know are in the default Wildfly 8.1.0.Final distribution. In particular, the cause of this question is the cxf-api jar file. I know it resides at this location in Wildfly:

wildfly-8.1.0.Final/modules/system/layers/base/org/apache/cxf/main/cxf-api-2.7.11.jar

but it is not being managed by the BOM recommended for Wildfly.

How do I correctly add cxf-api, and similar jar files, to the project's pom.xml, preferably without having to specify each one individually? Sure, I could do something like this:

<dependency>
  <groupId>org.apache.cxf</groupId>
  <artifactId>cxf-api</artifactId>
  <version>2.7.11</version>
  <scope>provided</scope>
</dependency>

but I'd really rather not have to do this for each and every jar file that is already a part of Wildfly.

Isn't there a BOM that I can import?

1
  • cxf-core (in version 3 of cxf replaces cxf-api) is now managed in WildFly boms 10.1.0.CR1 and newer versions. Aug 4, 2016 at 17:19

1 Answer 1

16

WildFly BOMs (aka JBoss Bill of Materials in its original version) is a set of dependencies used to enhance deployment of dependant projects and automate in some way their tests. It does not unfortunately includes dependencies used in WildFly core i.e. the Application Server.

The pom.xml (project descriptor) that you really need to import just the way you did for your BOMs pom file is the WildFly parent pom. So just import it into your own project pom and you will have your dependecies transitevelly resolved:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.wildfly</groupId>
      <artifactId>wildfly-parent</artifactId>
      <version>8.1.0.Final</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

Checkout the Apache CXF version used in the target WildFly version and just pick up the stable tags that match your needs.

5
  • Thanks! Do I use this instead of, or in addition to, the original BOM?
    – EdwinW
    Sep 9, 2014 at 2:44
  • 2
    Just keep both, there is absolutely no drawbacks on that. Don't forget to accept the answer if you are statisfied with ;)
    – tmarwen
    Sep 9, 2014 at 8:20
  • This sounds like a perfect solution for my current problem... but it doesn't seem to work. I've added the exact same XML to my parent pom.xml... and the just the following to my project module pom.xml: <dependency><groupId>org.wildfly</groupId><artifactId>wildfly-server</artifactId></dependency> – but it doesn't compile. Feb 19, 2015 at 9:37
  • It would be difficult to track the issue like that. Could you please address a new thread and just give a sign ;)
    – tmarwen
    Feb 21, 2015 at 12:06
  • 1
    @DanielBleisteiner If you actually put 'wildfly-server' in your XML, that's the problem. It needs to be 'wildfly-parent'. In addition, that only establishes the dependency management. You'll still need to specify the necessary dependencies in any child pom.xml files.
    – EdwinW
    Dec 16, 2015 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.