• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

create a war file

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can anybody have idea, how to create a war file in eclipse.

Thanks,
Chandra
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can tell you how to do it from the command line:

Cd to the root of your webapp.
Type:
jar cvf MyApp.war *


For something Eclipse specific, you might want to check out our IDEs forum.
https://coderanch.com/forums/f-12/vc
[ August 31, 2005: Message edited by: Ben Souther ]
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably just want to create an ANT script and run it from inside Eclipse.
 
shekar march chandra
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

David i think you are right. Can u tell me how to write an ant script.

Thanks,
chandra
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This isn't really a servlet question, it could be either an ANT or Eclipse question (as it currently stands).

I'll move this question to the Ant, Maven and Other Build Tools forum, we'll continue the conversation over there.

Dave
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here now

Without knowing how much ANT you've done:

1) In the root of your project (or the root of your war file, or where ever is appropriate) create a new file called build.xml. It can ce called something else, but Eclipse automatically treats build.xml files as ANT files.
2) Paste the following and edit to taste. It assumes the build.xml is in the project root directory and class files for the WAR are in the 'build' directory, the jsps are in the 'jsp' directory and the web.xml is in src/web.xml and the war file will be placed in the project root and be called 'my.war'

Note that I just paraphrased the ant instructions here



Now if you open the file in the Eclipse ANT editor and have the 'Outline' view open as well, you can right click the 'build_the_war' target and select 'Run as'> and then Ant. VIola, a war should appear. (I hope )

Dave
 
shekar march chandra
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David,

Really I was wondering how to write Ant script for creating war file.

After your suggestion and help, I was really happy.I followed the procedure told by you and created the war file and got deployed successfully in weblogic server.

Once again, Thanks a lot for your help.

By the way, I had doubts:

1. whats the difference between tomcat project and web project.

2. Is the procedure same even for ejbs.

Thanks,
Chandra
reply
    Bookmark Topic Watch Topic
  • New Topic