View RSS Feed

My Java Tips

Writing deployment descriptor

Rate this Entry
by , 05-25-2011 at 09:57 AM (2988 Views)
If you writing J2EE applications, you need to deploy your application to J2EE container like JBOSS. I will shed some light on how to write simple deployment descriptors for your web applications.

I am deploying my JSP application on JBOSS. For JBOSS, we need to put our application in WAR format in deploy folder. So deployment descriptor will have following 2 tasks:

  1. Archieve the application into WAR
  2. Copy that WAR to deploy folder of JBOSS

Assuming we are using default JBOSS configuration, following deployment descptor will serve our purpose:

Java Code:
"%JAVA_HOME%\bin\jar.exe" -cvf helloworld.war *.jsp WEB-INF
copy helloworld.war "%JBossHome%\server\default\deploy"
Make sure you set JBOSS_HOME to your jboss directory. Simply save the deployment descriptor in a batch file (deploy.bat) and run it to preapre archieve and deploy on JBOSS.

I used the switch -cvf with JAR command.

  • c for create new achieve
  • v for generate verbose output on standard output
  • f for specify archive file name

I hope this simple post will prove useful.

Submit "Writing deployment descriptor" to Facebook Submit "Writing deployment descriptor" to Digg Submit "Writing deployment descriptor" to Submit "Writing deployment descriptor" to StumbleUpon Submit "Writing deployment descriptor" to Google

Tags: j2ee, war Add / Edit Tags
Java EE , JBoss