How to create simple web application using Maven

Make sure that you have maven installed and environment variable set on your computer.
Open command prompt/terminal and give the following command.

Command:

mvn archetype:generate -DgroupId=com.test-app -DartifactId=test-app -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

This will create a project with archetype: maven-archetype-webapp

Import in your IDE:

IntelliJ Users

import

  • Create new project from existing source
  • Browser the project created from Maven
  • Select Import project from external model: Maven
  • Give Next, Next, Next
  • Deploy and run the app on the tomcat to test.

project-structure

Eclipse Users:

  • Similarly eclipse users can import by File > import > existing Maven Project
  • Next, Next, Next
  • Deploy and run the Project on Tomcat to test.

lc

 

 

Advertisements
How to create simple web application using Maven

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s