Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Generating a War File From a Plain IntelliJ Web Project

DZone's Guide to

Generating a War File From a Plain IntelliJ Web Project

· DevOps Zone ·
Free Resource

DevOps involves integrating development, testing, deployment and release cycles into a collaborative process. Learn more about the 4 steps to an effective DevSecOps infrastructure.

Sometimes you just want to create a quick web project in IntelliJ IDEA, and you would use their wizard and with web or Java EE module as starter project. But these projects will not have Ant nor Maven script generated for you automatically, and the IDEA Build would only compile your classes. So if you want an war file generated, try the following:

1) Menu: File > Project Structure > Artifacts
2) Click the green + icon and create a "Web Application: Archive", then OK
3) Menu: Build > Build Artifacts ... > Web: war

By default it should generate it under your <project>/out/artifacts/web_war.war


Note that IntelliJ also allows you to setup "Web Application: Exploded" artifact, which great for development that run and deploy to an application server within your IDE.

Read the 4-part DevOps testing eBook to learn how to detect problems earlier in your DevOps testing processes.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}