4 Replies Latest reply on May 10, 2012 10:59 AM by jcb001

    Quick deployment development with Eclipse

    jcb001

      Hi

       

      We are using jboss with Eclipse.

      To quickly develop I use the war in exploded view, and when I update a file, I launch an ant script to copy the file to the war.

      It's quick and I don't need to deploy completely the war and reconnect to the application.

       

      Anyway I am a little bit lazy, and I would like, when I save the file (JSP, java), the file being automatically copied to jboss (in the exploded war) (I mean I dont' need to save AND to launch the ant script)

       

      Do you know a way to do that ?

       

      It can be a tool, or just a way to catch the save event of a file in eclipse  ?

      If I can catch the save event in eclipse, then I will lauch automatically the ant script.

       

       

      Thanks for you answer

       

      NB I remember 10 years ago I did almost the same stuff with visual C++ by making macro, it was a piece of cake.

        • 2. Re: Quick deployment development with Eclipse
          jcb001

          Thank you Karsten, in fact I don't mean which (java) framework I can use to develop webpage quickly like JSF (personnaly I would choose GWT but it's another debat :-) ), I mean how to automatically deploy quickly a light update (I mean 1 or 2 files usually) into the war without having to redeploy all the war content (25 Mo).

           

          I know how to just deploy a single file with a ant script, I would just like to automatize the task when I save the file, and I don't know how catching the save event of a file in eclipse.

           

          This question could have been posted too on a eclipse forum too.

          • 3. Quick deployment development with Eclipse
            kwutzke

            That movie isn't about any frameworks, it's about JBoss Tools. The movie demonstrates incremental hot deploys of JBoss Tools... that's why I'm myself right in the middle of translating my completely unproductive Ant Catalina task setup to Eclipse/JBT. It even allows deployment to Tomcat, I wished I had known that earlier.

             

            Karsten

            • 4. Re: Quick deployment development with Eclipse
              jcb001

              Finally I heard about a product JRebel that do the trick.

               

              For those interested in a free, but not complete solution, I don't use Jrebel but I use both a dezipped war file in deployed directory AND use my own ant script :

               

               


              <target name="_QuickFileDeployerToWar" depends="compile">


              <echo>update jsp,js,xml...</echo>


              <copy todir="${dirDeploy}/${ProjectName}.war" verbose="true">



              <fileset dir="${web}" />


              </copy>


              <echo>update classes</echo>


              <copy todir="${dirDeploy}/${ProjectName}.war/WEB-INF/" verbose="true">



              <fileset dir="${classes}" />


              </copy>

              </target>

               

              So I just change a file (JSP, java class ) and launch this script _QuickFileDeployerToWar, the file will be copied, compiled inside the jboss directory.

               

              (doesn't manage all cases like file delete => just for my need)

               

               

              NB to unzip the war, just one time, I use an ant script :

              after deploying war I launch this script that unzip the war  :

               


              <target name="_ExpandWar">


              <echo>Extraction...</echo>


              <delete dir="${dirDeploy}/MYWAR.war.save" verbose="true" />


              <echo>Extraction 2 ...</echo>


              <rename src="${dirDeploy}/${warName}" dest="${dirDeploy}/${warName}.save"/>


              <mkdir dir="${dirDeploy}/${ProjectName}.war" />


              <unzip src="${dirDeploy}/${warName}.save" dest="${dirDeploy}/${ProjectName}.war">


              </unzip>


              <delete verbose="true">



              <fileset dir="${dirDeploy}" includes="**/*MyWAR*.save*" />


              </delete>


              <antcall target="_QuickFileDeployerToWar" />

              </target>

               

               

              and just launch jboss.

              Usually I use this script very rarely.