O'Reilly logo

Maven Essentials by Prabath Siriwardena

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

Java EE web applications with the archetype plugin

If you want to start with a Java EE web application, you can simply use the maven-archetype-webapp archetype to generate the Maven project skeleton, shown as follows:

$ mvn archetype:generate -B 
                   -DgroupId=com.packt.samples  
                   -DartifactId=my-webapp 
                   -Dpackage=com.packt.samples.webapp 
                   -Dversion=1.0.0  
                   -DarchetypeGroupId=org.apache.maven.archetypes  
                   -DarchetypeArtifactId=maven-archetype-webapp 
                   -DarchetypeVersion=1.0

The preceding command will produce the following directory structure. One issue here is that it does not have the java directory just after src/main. If you want to add any Java code, you need to make sure that you first create an src/main/java directory and create your Java ...

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