O'Reilly logo

Apache Maven Cookbook by Raghuram Bharathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a WAR project

So far, we have been building projects that generate a JAR artifact. When it comes to web applications, we typically create WAR artifacts. Maven supports the building of WAR artifacts. The packaging type .war indicates to Maven that it is a WAR artifact. Maven automatically invokes the corresponding lifecycle bindings.

How to do it...

  1. Run the following command from the command prompt:
    mvn archetype:generate –DinteractiveMode=false  -DgroupId=com.packt.cookbook -DartifactId=simple-webapp -DarchetypeArtifactId=maven-archetype-webapp 
    
  2. Observe the output:
    How to do it...
  3. Open the created pom file:
    <modelVersion>4.0.0</modelVersion> <groupId>com.packt.cookbook</groupId> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required