• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Packing and Unpacking WAR files

 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, Can anyone tell me how to do this.
i've placed the files I want in one folder and I've typed in the command line :
jar cvf test.war ServletSimplePublisher.java ServletSimplePublisher.class SimplePublisher.html web.xml
is it correct to copy all files you r gonna pack in a folder and then jar it?
Now, I've got a test.war file. How do I unpack it?
thanks
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't have the correct WAR file structure, your WAR needs to look something like this:

Then to jar it you can type:
jar cvf test.war *
or
jar cvf test.war SimplePublisher.html WEB-INF/web.xml WEB-INF/classes/ServletSimplePublisher.class WEB-INF/src/ServletSimplePublisher.java
There's no need to unpack your WAR file in order to deploy it to your application server. But, if for some odd reason you want to explode the WAR, you can use a program such as WinZip, or you can use the jar tool:
jar xvf test.war
The HP Application Server comes with some great TrailMaps that will introduce you to WAR files, their structure, and how they work. HP-AS also comes with a deployment tool called RadPak that makes creating and deploying WAR files quite easy. -- And better yet, HP-AS is totally free.
[ February 14, 2002: Message edited by: Jessica (Bradley) Sant ]
 
Mike Monali
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to use Apache's ANT for this purpose? Does anyone know how to do this? Thanks!
 
Steve Fahlbusch
Bartender
Posts: 605
7
Mac OS X Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ant can be used to copy files, make directories, complile source, run tests, pack into jars, wars
and ears.
I you want a detailed intro to how to get ant
to do all this look at: Java Tools for eXtreme
Programming (Hightower & Lesiecki )
-steve
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic