2 Replies Latest reply on Jun 21, 2012 7:47 AM by komat

    Is there a JBoss AS7 BOM?  Are there libraries exposed outside of jboss-javaee-6.0-with-tools?

    sboscarine

      Hello All,

      I need to port an application to JBoss AS7.  I'd like to reuse container libraries, when possible. 

       

      Is there a BOM that reflects all libraries exposed to an application that's closely tied to the AS server release? 

       

      Also, if I move from Jboss AS 7.0.0 to 7.1.1, I would love to just change the version number of the BOM and know I am compiling against the correct libraries.  I noticed in the quickstart applications that there's a Java EE 6 BOM:

      https://repository.jboss.org/nexus/content/repositories/releases/org/jboss/bom/jboss-javaee-6.0-with-tools/1.0.0.M7/jboss-javaee-6.0-with-tools-1.0.0.M7.pom

       

      Is this a full list of all libraries exposed to an application deployed to JBoss AS 7.1.1? 

       

      For example, I noticed $JBOSS_HOME/modules/org/apache/commons/lang/main/commons-lang-2.6.jar and my application uses commons-lang.  If commons-lang-2.6 is already exposed to my application, I would like to just use whatever the container provides. 

       

      Thanks!

      Steven

        • 1. Re: Is there a JBoss AS7 BOM?  Are there libraries exposed outside of jboss-javaee-6.0-with-tools?
          bcowdery

          I'm not sure about the availability of a BOM, but you might try browsing through the "org.jboss.as" group on the JBoss nexus site (https://repository.jboss.org/nexus/index.html) - jboss-as-parent looks like a likely candidate.

           

          I use Apache Ivy for my projects, and here's how I've got my dependencies mapped. It was easier with AS 7.0.0 since JBoss provided a jboss-as-api artifact that referenced all of the public API's and classes that came bundled with AS 7.

           

          <dependency org="org.jboss.as" name="jboss-as-api" rev="7.0.0.Final">

           

          AS 7.1.1 was trickier since the above api artifact is missing (or maybe it hasn't been built yet?). So for AS 7.1.1 you're forced to reference each dependency you use. This can be a headache when your trying to map dependencies from an existing project, but in the end you'll have a more explicit list of artifacts that your application depends on. It looks like this route will work with all of the JBoss AS6 & 7 releases.

           

          Start with:

           

          <dependency org="org.jboss.spec" name="jboss-javaee-6.0" rev="3.0.0.Final" conf="provided"/>

          <dependency org="org.jboss.as" name="jboss-as-spec-api" rev="7.1.1.Final" conf="provided"/>

           

          And add on modules as you go:

           

          <dependency org="org.jboss.as" name="jboss-as-spec-api" rev="7.1.1.Final"/>

          <dependency org="org.jboss.as" name="jboss-as-ee" rev="7.1.1.Final"/>

          <dependency org="org.jboss.as" name="jboss-as-web" rev="7.1.1.Final"/>

          <dependency org="org.jboss.as" name="jboss-as-transactions" rev="7.1.1.Final"/>

          <dependency org="org.jboss.as" name="jboss-as-jpa-hibernate4" rev="7.1.1.Final"/>

           

          If you find a better solution let me know, or better yet, if somone at JBoss can provide an official recommendation?

          • 2. Re: Is there a JBoss AS7 BOM?  Are there libraries exposed outside of jboss-javaee-6.0-with-tools?
            komat

            Maybe this is what you seek, we use it as bom in our project:

            https://repository.jboss.org/nexus/index.html#nexus-search;quick~jboss-as-parent

             

             

            This is wjat we have in our pom.xml - without the individual dependencies of course:

            <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <jboss.home>${env.JBOSS_HOME}</jboss.home>
                <jboss.domain>default</jboss.domain>
                <jboss.version>7.1.1.Final</jboss.version>
            </properties>
            
            <dependencyManagement>
                <dependencies>
                    <dependency>
                        <groupId>org.jboss.as</groupId>
                        <artifactId>jboss-as-parent</artifactId>
                        <version>${jboss.version}</version>
                        <type>pom</type>
                        <scope>import</scope>
                    </dependency>
                </dependencies>
            </dependencyManagement>
            
            <repositories>
                <repository>
                    <id>repository.jboss.org</id>
                    <name>JBoss Repository</name>
                    <url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
                </repository>
            </repositories>
            

             

             

            Our dependencies then look like:

            <dependencies>
            
                ...
            
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                </dependency>
            
                <dependency>
                    <groupId>org.jboss.spec</groupId>
                    <artifactId>jboss-javaee-6.0</artifactId>
                    <scope>provided</scope>
                    <type>pom</type>
                </dependency>
            
                <dependency>
                    <groupId>org.jboss.solder</groupId>
                    <artifactId>solder-impl</artifactId>
                </dependency>
            
                <dependency>
                    <groupId>org.jboss.solder</groupId>
                    <artifactId>solder-api</artifactId>
                </dependency>
            
                ...
            
            </dependencies>
            
            

             

             

            Hope that helps :-)

            koma

             

             

             

            [EDIT] here is another link that might give some more info: http://navinpeiris.com/2011/07/19/importing-jboss-7-dependencies-through-maven/