4 Replies Latest reply on Oct 28, 2010 3:52 AM by Jens Mander

    Maven: Deployment of just the ear-file

    Jens Mander Newbie

      Hi,

       

      I have an EJB3 project which I'd like to build and afterwards deploy it on the JBossAS 5 server. This works pretty well if I exceute

       

      cd myProject
      mvn clean package install
      

       

      and

       

       

      cd my-ear
      mvn jboss:hard-deploy
      

       

      in separat steps. But what I really want is to do this in one single maven call so I can use it from within eclise in an easy way. Unfortuantely the pom-file of the project doesn't except the goal jboss:hard-deploy -Dfilename=my-ear/my-ear.ear

       

      May anybody tell me how to combine the building and deployment process? Thank a lot.

       

      Sascha

        • 1. Re: Maven: Deployment of just the ear-file
          jaikiran pai Master

          I haven't tried it with a multi module project, but does this work from the "myProject" folder:

           

          mvn clean install jboss:hard-deploy

          • 2. Re: Maven: Deployment of just the ear-file
            Jens Mander Newbie

            Hi Jaikiran,

             

            thanks for your quick relpy to my post. What you metioned works fine from my every single module but not from the project's root folder.

            This is my structure

             

            myProject/
             ... my-api
             ... my-ear
             ... my-entity
             ... my-impl
             ... pom.xml
            

             

            and this is the pom-file of "myProject"

             

            <?xml version="1.0" encoding="UTF-8"?>
            <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
                <modelVersion>4.0.0</modelVersion>
                <groupId>org.myProject</groupId>
                <artifactId>myProject</artifactId>
                <version>0.0.1-SNAPSHOT</version>
                <packaging>pom</packaging>
                <name>Duck</name>
                <properties>
                    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                </properties>
            
                <dependencies>
                </dependencies>
                <distributionManagement>
                    <repository>
                        <id>nexus</id>
                        <url>http://...</url>
                    </repository>
                    <snapshotRepository>
                        <id>nexus</id>
                        <url>http://...</url>
                    </snapshotRepository>
                </distributionManagement>
                <modules>
                    <module>my-api</module>
                    <module>my-impl</module>
                    <module>my-entity</module>
                    <module>my-ear</module>
                </modules>
            </project>
            

             

            May you tell me how you deploy ear-files in a development environment if you don't do it like that? For testing and debugging reasons I often need to deploy my application and take a look how it works so I'm trying to find a solution how to deploy the app with just one "click/call" instead of building and deploying it separately. Is there another way to do it so I picked a totally wrong way? It would be nice if you can give me some expert advice how to build and deploy such projects.

             

            Sascha

            • 3. Re: Maven: Deployment of just the ear-file
              jaikiran pai Master
              May you tell me how you deploy ear-files in a development environment if  you don't do it like that? For testing and debugging reasons I often  need to deploy my application and take a look how it works so I'm trying  to find a solution how to deploy the app with just one "click/call"  instead of building and deploying it separately. Is there another way to do it so I picked a totally wrong way? It would  be nice if you can give me some expert advice how to build and deploy  such projects.

              Sascha, personally I don't use any IDE for deploying my applications. And I also try to avoid any of the Maven plugins for deploying my applications. Some might consider it silly, but I personally find it more easy to either manually do the deployment or use an Ant script to do it. I did try out Maven plugins to do the deployment, when I first got introduced to Maven. But I found it to be more of a pain (due to various issues) than any actual help.

               

              Maybe someone else from the community will be able to suggest you an IDE based or Maven based approach.

              • 4. Re: Maven: Deployment of just the ear-file
                Jens Mander Newbie

                Hey,

                 

                thanks so maybe anybody else has some hints