0 Replies Latest reply on Sep 15, 2011 10:01 AM by guinotphil

    How to make modules available to all subdeployements of an EAR ?

    guinotphil Apprentice

      Hi !

       

      I've been using JBoss AS 7 and its modules for quite a while now, but I'm actually still running with a issue for the availability of modules in subdeployements.

       

      I've got a certain amount of modules which I want to be accessibles in all subdeployements of a single EAR. I currently use the following jboss-deployement-structure.xml

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-deployment-structure>
                <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
                <deployment>
                          <exclusions>
                                    <module name="javax.faces.api" />
                                    <module name="com.sun.jsf-impl" />
                                    <module name="org.jboss.as.jpa.hibernate" />
                                    <module name="org.hibernate" />
                          </exclusions>
                          <dependencies>
                                    <module name="com.sun.jsf-impl" slot="1.2" />
                                    <module name="javax.faces.api" slot="1.2" />
                                    <module name="org.jboss.as.jpa.hibernate" slot="3"/>
                                    <module name="org.hibernate" slot="3"/>
                                    <module name="module1" />
                                    <module name="module2" />
                                    <module name="module3" />
                                    <module name="module4" />
                          </dependencies>
                </deployment>
        
        
                <sub-deployment name="module1.jar">
                          <exclusions>
                                    <module name="javax.faces.api" />
                                    <module name="com.sun.jsf-impl" />
                                    <module name="org.jboss.as.jpa.hibernate" />
                                    <module name="org.hibernate" />
                          </exclusions>
                          <dependencies>
                                    <module name="com.sun.jsf-impl" slot="1.2" />
                                    <module name="javax.faces.api" slot="1.2" />
                                    <module name="org.jboss.as.jpa.hibernate" slot="3"/>
                                    <module name="org.hibernate" slot="3"/>
                                    <module name="module1" />
                                    <module name="module2" />
                                    <module name="module3" />
                                    <module name="module4" />
                          </dependencies>
                </sub-deployment>
        
        
                <sub-deployment name="module2.war">
                          <exclusions>
                                    <module name="javax.faces.api" />
                                    <module name="com.sun.jsf-impl" />
                                    <module name="org.jboss.as.jpa.hibernate" />
                                    <module name="org.hibernate" />
                          </exclusions>
                          <dependencies>
                                    <module name="com.sun.jsf-impl" slot="1.2" />
                                    <module name="javax.faces.api" slot="1.2" />
                                    <module name="org.jboss.as.jpa.hibernate" slot="3"/>
                                    <module name="org.hibernate" slot="3"/>
                                    <module name="module1" />
                                    <module name="module2" />
                                    <module name="module3" />
                                    <module name="module4" />
                          </dependencies>
                </sub-deployment>
      
      
                <sub-deployment name="module3.jar">
                          <exclusions>
                                    <module name="javax.el.api" />
                                    <module name="javax.faces.api" />
                                    <module name="com.sun.jsf-impl" />
                                    <module name="org.jboss.as.jpa.hibernate" />
                                    <module name="org.hibernate" />
                          </exclusions>
                          <dependencies>
                                    <module name="com.sun.jsf-impl" slot="1.2" />
                                    <module name="javax.faces.api" slot="1.2" />
                                    <module name="org.jboss.as.jpa.hibernate" slot="3"/>
                                    <module name="org.hibernate" slot="3"/>
                                    <module name="module1" />
                                    <module name="module2" />
                                    <module name="module3" />
                                    <module name="module4" />
                          </dependencies>
                </sub-deployment>
      
      
                <sub-deployment name="module4.jar">
                          <exclusions>
                                    <module name="javax.el.api" />
                                    <module name="javax.faces.api" />
                                    <module name="com.sun.jsf-impl" />
                                    <module name="org.jboss.as.jpa.hibernate" />
                                    <module name="org.hibernate" />
                          </exclusions>
                          <dependencies>
                                    <module name="com.sun.jsf-impl" slot="1.2" />
                                    <module name="javax.faces.api" slot="1.2" />
                                    <module name="org.jboss.as.jpa.hibernate" slot="3"/>
                                    <module name="org.hibernate" slot="3"/>
                                    <module name="module1" />
                                    <module name="module2" />
                                    <module name="module3" />
                                    <module name="module4" />
                          </dependencies>
                </sub-deployment>
      
      
      
      
                <sub-deployment name="module5.war">
                          <exclusions>
                                    <module name="javax.faces.api" />
                                    <module name="com.sun.jsf-impl" />
                                    <module name="org.jboss.as.jpa.hibernate" />
                                    <module name="org.hibernate" />
                          </exclusions>
                          <dependencies>
                                    <module name="com.sun.jsf-impl" slot="1.2" />
                                    <module name="javax.faces.api" slot="1.2" />
                                    <module name="org.jboss.as.jpa.hibernate" slot="3"/>
                                    <module name="org.hibernate" slot="3"/>
                                    <module name="module1" />
                                    <module name="module2" />
                                    <module name="module3" />
                                    <module name="module4" />
                          </dependencies>
                </sub-deployment>
      
      
      </jboss-deployment-structure>
      

       

       

      Is there a way to not repeat all the dependencies in every modules ? I was originally expecting ear-subdeployments-isolated FALSE to make the job, but according to the documentation this only deals with lib shipped in the EAR.

       

      I also read in the documention about the global modules, but this would be for any EAR, while I wanna just to this for a single EAR.

       

      Any idea?

       

      Thanks