How to make war file in Eclipse

John picture John · Feb 24, 2011 · Viewed 169.1k times · Source

What is the easy way to make war file?

My project is working when i right click run on server, but i want to deploy on tomcat server. I have installed m2clipse but it gave me an error.

  1. Is maven compulsory to make war file?
  2. Do i need special directory structure to make war with eclipse?

    Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project testing2: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1] [ERROR]

Answer

Konstantin Komissarchik picture Konstantin Komissarchik · Feb 24, 2011

File -> Export -> Web -> WAR file

OR in Kepler follow as shown below :

enter image description here