6 Replies Latest reply: Oct 17, 2011 5:48 AM by Frank Henry RSS

    Add all AS7 libs to a Maven project

    jaabax Newbie

      hi

      how can I add all jboss 7 libs (hibernate, log4j and etc) to my maven project?

      should I have to do this one by one or there is a way to add all together?

      thanks

        • 1. Re: Add all AS7 libs to a Maven project
          Gonne Martens Novice

          Hi,

           

          do you want to add all libs from JBoss7 or do you only want the same versions of some libs used by JBoss7 added to your maven project?

           

          Regards,

          Gonne

          • 2. Re: Add all AS7 libs to a Maven project
            jaabax Newbie

            can I have both =)

             

            but... let me understand...

             

            when you say "do you want to add all libs from JBoss7", you want to say that there is a public repository that maintains the updated versions of all JBoss 7 libs?

             

            for my project, I simply need all libs that ships with JBoss 7 server (libs inside the "JBOSS_HOME/modules" directory)

            hibernate, jpa, logger and etc...

             

            thanks

            • 3. Re: Add all AS7 libs to a Maven project
              David Beaumont Newbie

              Does this help?

               

               

                <repositories>
                      <repository>
                        <id>repository.jboss.org</id>
                        <name>JBoss Repository</name>
                        <url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
                      </repository>
                </repositories>
              
                <dependencies>  
                  <dependency>
                    <groupId>org.jboss.spec</groupId>
                    <artifactId>jboss-javaee-6.0</artifactId>
                    <version>2.0.0.Final</version>
                    <type>pom</type>
                    <scope>provided</scope>
                  </dependency>
                </dependencies>
              

               

              • 4. Re: Add all AS7 libs to a Maven project
                jaabax Newbie

                hi David Beaumont

                you posted an artifactId called "jboss-javaee-6.0"

                this artifactId refer to the "Everything (NOT Java EE6 Certified)" JBoss version?

                if I want the libs of "Web Profile Only (Java EE6 Certified)" JBoss version, should I use the artifactId called "jboss-javaee-web-6.0"?

                thanks in advance

                • 5. Re: Add all AS7 libs to a Maven project
                  David Beaumont Newbie

                  I haven't tested that, but I assume so. You can search for artifacts at: https://repository.jboss.org/nexus/index.html#nexus-search;quick~jboss-javaee

                   

                  Dave

                  • 6. Re: Add all AS7 libs to a Maven project
                    Frank Henry Novice

                    While I cannot help you directly, here are some tips:

                     

                    Why do you need all the libs? You usually only need the libs you use in your mvn project. If a dependency needs another lib, it will automatically resolve this as well.

                     

                    Also, many of the libs in as7 are also built with mvn, so you can simply open up the artefact and go to META-INF/maven and get the artefactId & groupId from there.

                     

                    Oh, and if you are unsure what you need (and this is not pretty) you can simply grep for the class and see what jar pops up, then include that in the dependencies. Though you might have multiple hits, then you have to find the correct one.