This will create maven web project structure and web application specific files like web.xml.
2. Convert to eclipse dynamic web project
To Convert created maven web project to eclipse dynamic web project, following maven command needs to be run.
$ mvn eclipse:eclipse -Dwtpversion=2.0
Please remember that adding “-Dwtpversion=2.0” is necessary, otherwise using only “mvn eclipse:eclipse” will convert it to only normal Java project (without web support), and you will not be able to run it as web application.
3. Import web project in Eclipse
Click on File menu and click on Import option.
Now, click on “Existing project..” in general section.
Now, browse the project root folder and click OK. Finish.
Above steps will import the project into eclipse work space. You can verify the project structure like this.
In this maven tutorial, we learned how to create maven dynamic web project in eclipse. In this example, I used eclipse oxygen. You may have different eclipse version but the steps to follow will be same.