Create Dynamic Web Project Maven command prompt

Create Dynamic Web Project Maven command prompt

This demo will show you how to Create Dynamic Web Project Maven command prompt. To create dynamic maven project from command prompt please follow below steps:Steps:

  • Download Apache Maven from here: http://maven.apache.org/download.cgi
  • After download extract it to any folder
  • Go to command prompt:  Click Window –>All Program –>Accessories –> Command Prompt
  • Once your command prompt is open go to directory where you have extracted Maven then set class path of maven bin as below:

Create Dynamic Web Project Maven command prompt

  • To check if maven classpath set or not type mvn -version in command prompt as shown in above. It will show you Apache maven version.
  • Now we are all set to create Maven Project from prompt
  • From command prompt you could navigate to any directory wherever you want to create project for demo I have create workspace folder which is my eclipse workspace to create Maven project as below then enter following below command:

 C:\Maven>cd C:\workspace

C:\workspace>mvn archetype:generate -DgroupId=com.javahonk -DartifactId=TestMavenWebProject -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

  • GroupId: Package structure
  • artifactId: Project name to be created.
  • maven-archetype-webapp: Maven type of project is web project
  • Press enter in command prompt: You will see first time it download jars to local directory and will create project with successful build as below

Create Dynamic Web Project Maven command prompt

 

  • Now go to your workspace directory you will see TestMavenWebProject created.
  • That’s it.

 

Leave a Reply

Your email address will not be published. Required fields are marked *