Why is it so hard to make a WAR file?

It's version 11 of IDEA already. Can we please have a simple way to make a WAR file? I've been searching and searching and there seems to be no easy way to get a deployable WAR file that has the web.xml, all the libs, etc. built by IDEA without a lot of manual effort and the use of hard coded paths. All the information is in the project why do I have to do so much manual work? Currently, I have to:

  • Create a facet

  • Create an Artifact

  • Manaully create the libs directory in the Artifact

  • Manually tell the Artifact to copy my runtime libraries to the libs directory

Why so many steps? Further, this is error prone.

JetBrains - please help.

Original message URL: http://devnet.jetbrains.net/message/5455522#5455522

1 comment

You indeed need to create a facet and an artifact. However if you're developing a web app you should already have a web facet because many features of
IDEA (code completion, error highlighting etc) don't work without properly configured web roots.

The simplest way to create a war artifact is to create an exploded war artifact at first. Press '+' button above the artifacts list, choose 'Web
Application: Exploded' -> 'From modules' and select a module. IDEA will create an artifact and automatically add all required libraries to it.
After that create a war artifact using 'Web Application: Archive' -> 'For 'exploded'' item in the popup and IDEA will add a war artifact wrapping the
created exploded artifact.

I think we'll add an option to create a war artifact containing modules with required libraries directly without adding an exploded artifact.

Nikolay Chashnikov
Software Developer
JetBrains, Inc
"Develop with pleasure!"


Please sign in to leave a comment.