aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes How to generate a .war file in Eclipse ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to generate a .war file in Eclipse ?" Watch "How to generate a .war file in Eclipse ?" New topic
Author

How to generate a .war file in Eclipse ?

rodolfo de
Greenhorn

Joined: May 10, 2007
Posts: 1
I click right button mouse and try to export my Tomcat project into Eclipse
but there is no .war option.

This .war file is important as long as I want to deploy my first web application on EATJ webhost.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29287
    
140

Rodolfo,
Welcome to JavaRanch!

Eclipse doesn't support creating war files out of the box. What plugin are you using to do this or integrate with Tomcat.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
chacky boom
Greenhorn

Joined: Dec 30, 2008
Posts: 4
I used EATJ web hosting too. You just need go to your TOMCAT_HOME/webapps/ROOT directory and type: .

Upload the ROOT.war to your eatj tomcat server. You can use FTP or web interface to upload it. EATJ web hosting is very good. Try http://www.eatj.com/
Zenikko Sugiarto
Ranch Hand

Joined: Jan 09, 2005
Posts: 58
rodolfo de wrote:I click right button mouse and try to export my Tomcat project into Eclipse
but there is no .war option.

This .war file is important as long as I want to deploy my first web application on EATJ webhost.


I would suggest creating your own ant build.xml file and using the ant war task.
http://ant.apache.org/manual/CoreTasks/war.html

Generally, I would create a directory where I would assemble all the directory and files needed. This allows you to have a different file structure between development and deployment. An example of a development file structure of a web application could be as follow:



A build file can then be written to build (assemble) the above into a deployment structure, like so



After the deployment file structure is assembled (using ant) I can then archive it using the ant war task and generate something like. At this point I can also copy the change note, version, readme, and include it within the .war

project root/build/current --> projectName-version-date.war

Which can then be deployed using various ways - the easiest of which is to just copy it into an app server's deployment directory.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

"chacky boom", you have previously been warned on one or more occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Be aware that accounts with invalid display names are disabled.

bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Also, please read this with regards to resurrecting old posts.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to generate a .war file in Eclipse ?
 
Similar Threads
deployment to webapps
eclipse
war file
Eclipse/MyEclipse Existing War file
How to make a war file which not included the test packages?..