0

How can I do to use the maven dependency library instead of the Jboss library?

I have the following dependencies in my pom.xml file:

<properties>
    <jsf.version>2.2.8-02</jsf.version>
</properties>
...
<dependencies>
    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>${jsf.version}</version>
    </dependency>
    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>${jsf.version}</version>
    </dependency>
</dependencies>

But when I start Jboss AS I get the following message:

09:49:57,000 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-4) Initializing Mojarra 2.2.6-jbossorg-4 20140501-1134 for context ''

I think Jboss is using it own JSF libraries instead of maven libraries

The same thing happens using Jboss AS 7.1.1 and Wildfly 8.1.0 Final versions

John Alexander Betts
  • 4,718
  • 8
  • 47
  • 72
  • There are no JSF maven libraries. What you have is that your container (JBoss, Wildfly) does already provide an JSF implementation which you usually shouldn't change. So you shouldn't add an implementation to your dependencies or define a `provided` – khmarbaise Oct 15 '14 at 15:00
  • @khmarbaise Why I should use provided? What it does? – John Alexander Betts Oct 15 '14 at 15:07
  • Provided will pack the given dependency into your war/ear file cause it is provided by the target environment. – khmarbaise Oct 15 '14 at 15:49

1 Answers1

0

Alternatively you can change the classloader policy from parent first to application first while you create the binary package or configure that in Jboss.

This will allow your application binaries to be detected before using the version of JSF from jboss.

In case of WAR applications there is nothing much that you can do to control the classloader detection in Maven as mentioned here

Community
  • 1
  • 1
Raghav Vaidhyanathan
  • 745
  • 1
  • 10
  • 25