The Maven’s command to convert a Java project to support Eclipse IDE.

mvn eclipse:eclipse

The Maven’s command to create a Dynamic Web Project to support Eclipse IDE.

mvn eclipse:eclipse -Dwtpversion=1.5

Make sure the pom.xml, packaging is “war”, else the “-Dwtpversion” command will fail.

<project ...>
  <packaging>war</packaging>
  ...
</project>

P.S If you hit Unsupported WTP version: 1.5. This plugin currently supports only the following versions: 1.0 R7 error, please visit solution here

P.S If you want to convert existing Java project to a web project in Eclipse, you can convert it by modify the .project file – How to convert Java Project to Web Project in Eclipse

Reference

More about maven eclipse:eclipse command, please visit
http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html

More about maven -Dwtpversion=1.5 command, please visit
http://maven.apache.org/plugins/maven-eclipse-plugin/wtp.html

This article was posted in Maven category.

Related Posts