Monday, May 27, 2013

How To Convert Maven Based Web Application To Support Eclipse IDE


Web Application Project from Maven Template

In a terminal (*uix or Mac) or command prompt (Windows), navigate to the folder you want to store the project. Issue following command :
mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
This tell Maven to create a Java web application project from “maven-archetype-webapp” template.


On to creating your first project ! 

In order to create the simplest of Maven projects, execute the following from the command line:
mvn archetype:generate \
-DarchetypeGroupId=org.apache.maven.archetypes \
-DgroupId=com.mycompany.app \
-DartifactId=my-app

To convert a Maven based Java project to support IDE, you use this command :
mvn eclipse:eclipse
For web application, you need extra parameter to make it support Eclipse’s wtp, instead, you should use this command :
mvn eclipse:eclipse -Dwtpversion=2.0

No comments:

Post a Comment