vcj
vcj

Reputation: 61

How to import Wildfly dependencies in Maven

I'm trying to compile a project (webapp) with Maven and that project "uses" .jar's that are in the Wildfly installation directory (.../Wildfly.../modules/...). Is there an easy way to import all of these modules through the POM? I've tried using:

<dependency>
    <groupId>org.wildfly</groupId>
    <artifactId>wildfly-client-all</artifactId>
    <version>10.1.0.Final</version>
</dependency>

And it didn't work. After that I tried using:

<dependency>
    <groupId>org.wildfly</groupId>
    <artifactId>wildfly-ejb-client-bom</artifactId>
    <version>10.1.0.Final</version>
    <type>pom</type>
</dependency>
<dependency>
    <groupId>org.wildfly</groupId>
    <artifactId>wildfly-jms-client-bom</artifactId>
    <version>10.1.0.Final</version>
    <type>pom</type>
</dependency>

To no effect either, giving me the following error:

Could not resolve dependencies for project 
someproject:someproject:war:0.0.1-SNAPSHOT: The following artifacts 
could not be resolved: org.apache.activemq:artemis-
commons:jar:1.1.0.wildfly-017, org.apache.activemq:artemis-core-
client:jar:1.1.0.wildfly-017, org.apache.activemq:artemis-hqclient-
protocol:jar:1.1.0.wildfly-017, org.apache.activemq:artemis-jms-
client:jar:1.1.0.wildfly-017, org.slf4j:jcl-over-slf4j:jar:1.7.7.jbossorg-1: 
Could not find artifact org.apache.activemq:artemis-
commons:jar:1.1.0.wildfly-017 in central 
(https://repo.maven.apache.org/maven2)

Any tips would be appreciated.

Upvotes: 6

Views: 1825

Answers (1)

hradecek
hradecek

Reputation: 2513

The wildlfy feature pack [1][2], contains pretty much everything that Wildlfy uses for distribution. However, this has way much more dependencies that you actually need, in most cases. So, just be aware of it.

You can also check out Wildlfy BOMs [3][4], which might be useful for you, as well.

Happy Coding!


[1] https://mvnrepository.com/artifact/org.wildfly/wildfly-feature-pack/11.0.0.Final

[2] https://github.com/wildfly/wildfly/tree/master/feature-pack/src/main/resources/modules/system/layers/base

[3] https://mvnrepository.com/artifact/org.wildfly.bom/wildfly-javaee7

[4] https://github.com/wildfly/boms

Upvotes: 1

Related Questions