3 Replies Latest reply on Aug 5, 2013 1:07 PM by Gabriel Francisco dos Santos Silva

    Deploy Project using Maven.

    Gabriel Francisco dos Santos Silva Newbie

      I have two projects, the first one is called domain, which has the model stuff, entities... The second one is the EJB Project.

      I already added my domain project to the pom.xml of the EJB Project, compile scope, but, when I try to deploy to JBoss, I'm getting a ClassNotFoundException of classes from the domain module.

       

      Is there something that I'm missing?

       

      Thanks in advance!

        • 1. Re: Deploy Project using Maven.
          Stephen Coy Master

          Hi there,

           

          The normal strategy for your situation is to combine your two artifacts into a third artifact, being an EAR file.

           

          You make use of the Maven EAR Plugin to build this and configure it like the following for JBossAS/WildFly:

          {code:xml}<plugin>

                    <groupId>org.apache.maven.plugins</groupId>

                    <artifactId>maven-ear-plugin</artifactId>

                    <version>2.8</version>

                    <configuration>

                              <version>6</version>

                              <defaultLibBundleDir>lib</defaultLibBundleDir>

                    </configuration>

          </plugin>{code}

           

          This will also automatically include any other project dependencies that you have.

          • 2. Re: Deploy Project using Maven.
            Gabriel Francisco dos Santos Silva Newbie

            Hey! Thanks for answering.

             

            Well, I tried to do it, I could deploy, but it seems that my EJBs was not deployeds, I mean... You know, when you deploy an EJB Project on JBoss AS 7, it shows in the console every EJB that you have on your project, and, when I deploy my project it doesn't show any EJB in there. And when I try to lookup some EJB it says that there's no EJB.

            Also I tried to use the packing EJB, but I get this message: Error executing FORCE_DEPLOY.

             

            Any guess?

             

            Thanks again!

            • 3. Re: Deploy Project using Maven.
              Gabriel Francisco dos Santos Silva Newbie

              Well, sorry, I didn't understand what you meant at first, I tried to change my EJB Project to an EAR Project, so it didn't work. haha

              After that, I declared every module (ejb, war, jar) inside an EAR project, with all dependencies, and, in the others modules, I declared the dependencies with provided scope.

              Everything is working fine, thanks!