Post navigation

taT | “Deploy on Build” Using JBoss

Recently, I had asked a question on NetBeans Forums on the “Deploy-on-Save” feature supported by NetBeans 6.5 IDE. Well, I know I can’t configure build script in such a way, so that it can deploy on save. However, I found a trick to deploy the war file everytime I build OR clean and build .

Brief Overview

This trick will save your time and do lot more stuff with an existing shortcut, which you might have missed otherwise. Actually, I was working on a “Dynamic Web project” in Eclipse IDE where I was supposed to make use of its 2.0.0.Beta2 version using JBoss 4.0.5 GA (with Java EE Platform set to “J2EE 1.4″ ). Eclipse was so slow and its editor support for JSP pages was doing no good. Probably, if I could have used a new release of Eclipse, then that might have helped. Still, I am not sure, its just an assumption.

Also, everytime I made changes I had to first right-click project node, then select “Run As > Run on Server” and if I made any changes during runtime, it was not deploying automatically. Although, “Project” menu showed project to be build automatically . So, I had to repeat the cycle again and again.

Due to the above stated issues/problems, I decided to import the complete project into NetBeans 6.5 IDE. Import was successful and I added the JBoss server into NetBeans IDE (“Tools > Servers” ). Now, project is successfully building and deploying. Its absolutely working fine.

Now, NetBeans 6.5 didn’t supported “Deploy on Save” feature for the web applications that were using JBoss Application Server (I am referring to the above release), as per my recent observation.

Then, when I made changes to the webpages in the earlier mentioned project, I still couldn’t deploy on save/build. So, I had to right-click the “Project Node” and click “Deploy”. This cycle is shorter one, still frustating if one makes changes frequently.

Tricks..

Now, open your project’s build.xml file and here’s the trick you need to do;
Add the following tags;

Tips to Remember..

The moment you use “Shift-F11″ or “F11″, the project will deploy the “war” file, however it will not run the browser for you, as it was doing earlier. If you have better solution, or encounter some problems, do let me know. Hope this helps.