Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I make a war file?

 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I make a war file?

I tried:
% jar cf webapp.jar webapp

and then rename webapp.jar to webapp.war, but the webapp won't run under tomcat. When I decompressed the webapp.jar with a tool, I found all the directories inside webapp.jar were placed in Tomcat's webapps directory, not in webapps/webapp.


I tried posting a similar question the Ant forum because i'm using Ant, but I don't have to use ant, I just have to make a war file.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65228
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't cross post. See the post in the Ant forum for a question I posed.
 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question here is related to the command line.


The question I posted in the Ant forum is related to Ant.
 
Tarun Gandhi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try:

cd webapps/webapp
jar cf ../webapp.war *

This will make a war file containing the contents of webapp and store it in the webapps directory. (Thanks Rusty Enisin. I misunderstood the question.)
[ August 02, 2005: Message edited by: Tarun Gandhi ]
 
Rusty Enisin
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you have to make the war file like this:



This will put the war file in the webapps dir. If you want it some place else, change ../ to some place else.

Doing it the way mentioned in the previous post will not create a well formed war file. I am not sure, but I think it will not even run.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic