Posted in eclipse, maven, web application

Maven – Generate web project for eclipse with maven

To generate an empty project from the scratch you just need 2 command line:

1. generate a web project with maven
2. generate eclipse project.

1. Generate web project with maven:


Generally, to generate a project from maven, we need to do the following command:


mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

Usage example:

mvn archetype:generate -DgroupId=net.webanalytics -DartifactId=webapp -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false.

2. Convert to  eclipse project:

mvn eclipse:eclipse -Dwtpversion=2.0

What version of Eclipse does WTP work with?

  • WTP 1.0.x runs on Eclipse 3.1.x.
  • WTP 1.5.x runs on Eclipse 3.2 (a.k.a. Callisto).
  • WTP 2.0.x runs on Eclipse 3.3 (a.k.a. Europa).
  • WTP 3.0.x runs on Eclipse 3.4 (a.k.a. Ganymede).
  • WTP 3.1 runs on Eclipse 3.5 (a.k.a. Galileo).
  • WTP 3.2 runs on Eclipse 3.6 (a.k.a. Helios).
  • WTP 3.3 runs on Eclipse 3.7/4.1. (a.k.a. Indigo)
  • WTP 3.4 is intended for Eclipse 3.8/4.2. (a.k.a. Juno)