The Maven’s command to create a java project in eclipse.

mvn eclipse:eclipse

The Maven’s command to create a Dynamic Web Project in eclipse.

mvn eclipse:eclipse -Dwtpversion=1.5

P.S 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. Please access my previous article to understand how do to it
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