IngeniousTom IngeniousTom - 3 months ago 6x
Java Question

Is it possible to package into single war?

I finished developing my web app and now after packaging it I get the following structure in output path:


Is it possible to package all these folders and files into a single war file (like developers do it with uber-jar or fat-jar)?
I mean I just want a single war file in target folder as result of


I also want my single war file being executable (on double-click), if it is possible.


I think you just didn't understand the major idea of the .war packaging. You should consider it as an independent module which doesn't have any relations with the outer world. Therefore, you could use it on different systems and with different web containers (as has been mentioned in the comments, they are JBoss, GlassFish, WebSphere).

All this brings the following advantages:

  • Easy testing and deployment of web applications;
  • Easy identification of the version of the deployed application;
  • All Java EE containers support WAR files;
  • MVC Structure also support WAR files.