1 Reply Latest reply on Feb 11, 2011 4:44 PM by David Lloyd

    Dependencies in module.xml

    Stan Silvert Master

      I'm trying to add JSF jars to the classpath when a WAR is deployed.

       

      I now have modules for javax.faces.api and javax.faces.impl.  (The impl one will go away eventually)

      jboss-7.0.0.Aplpha2/modules/javax/faces/api/<jar, index, and module.xml>

      jboss-7.0.0.Aplpha2/modules/javax/faces/impl/<jar, index, and module.xml>

       

      That part looks OK to me.

       

      So now how do I get those jars on the classpath when a WAR is deployed?  I tried adding this to the org.jboss.as.web module.xml:

       

      <dependencies>

              ...      

              ...

              <module name="javax.faces.api"/>

              <module name="javax.faces.impl"/>

             ...

             ...

      </dependencies>

       

      However, that seemed to have no effect.  When the WAR deploys it can't find a JSF impl class I specified in web.xml.

       

      What is the proper way to do this?

       

      Stan

        • 1. Dependencies in module.xml
          David Lloyd Master

          The "org.jboss.as.web" module corresponds to the module built in the "web" subdirectory of AS - it's just the deployer and subsystem classes for the "web" subsystem, it doesn't affect the deployment class path in any way.  To put things on the deployment class path, your deployment unit processor has to add the libraries as a dependency.  For a good example of how to do that, look at org.jboss.as.weld.deployment.processors.WeldDependencyProcessor (in particular, note how dependencies are added).