Create Maven Web Application By Using cmd prompt:

Introduction to Maven:

In general we can define simply the Maven as following:

  • Maven is nothing but it is referred as a Built Tool.
  • We can use it to built the artifacts which is to be deployed from source code.
  • Maven helps us to give an elegant solution for each problem.

Built tool is mainly responsible for the following things to be done:

  • Pre processing
  • Compilation
  • Packaging
  • Testing
  • distribution

The common problems which we will get and the activities which we should done while dealing with Built tool are:

Multiple Jars:

If we are dealing with any hibernate project or spring , then to design web application we need to install jars which are reqired at compile time.

Dependencies and versions:

One particular jar will have the dependency on other jar, we have to make sure that all the dependent jars supplied because of versions, it could be differ that matching the right versions of jar in our dependency.

Project Structure:

The thing which we should done set up project structure is we need to setup proper directories, WEB-INF, libraries to build the data, to publish and deploy it.

If we are doing Ant Project then write all those targets, excecute whenever we want to publish and deploy.

Moreover Maven is referred comprihensively as ProjectManagementTool.

Create Maven Web Application By Using cmd prompt:

  • To deal with Maven project Internet connection is must.

Step1: →Open command prompt and go to target working directory , in my case i.e. C:\user\GEEK

C:\Users\GEEK>mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes
-DarchetypeArtifactId=maven-archetype-webapp
-DgroupId=com.gl -DartifactId=projectname


open the command prompt and go to working directory and type the command which is given above the image

Step2: It will download all required maven jars, supporting files from the internet.

it will downloads all the requiredmaven jars,supportinf files from internet

Step3: Finally you can see "BUILD SUCCESSFULLY " in the cmd prompt.

Then go and check in directory in my case ‘C:\Users\GEEK’ for project structure.

go and check in directory and where u can see project stucture

Copy webapp folder(in your project folders).

webapp folder(in your project folders)

Paste the copied ‘ webapp ’ folder in tomcat into the ‘webapps’ folder.
Then ‘ Rename the copied folder

Paste the copied 'webapp' folder in
						tomcat into the ‘webapps’ folder. Then Rename the copied folder

Open web browser then type following code
http:\\localhost: portnumber(ex:8099)

It will open tomcat container page.

Opened Tamcat Catalena home

Then click on “tomcat manager” type user name : ------- , password : -------

type the tomcat username and password

After login open the Tomcat Web Application Manager Home page.

login open the Tomcat Web Application Manager

Finally click on your project name

It will display the project output…..

then click on the project which u want and it will display the output
HTML Comment Box is loading comments...