Pages

Wednesday, April 25, 2012

My First Project in Maven

Steps to build and execute a maven project

·    Install jdk 1.7 and set the class path
·     Install 3.0.4 and set the class path -http://maven.apache.org/download.html#Installation
·    Type “mvn –version” in the command prompt to check whether the maven installed properly or not.
 ·   Create a directory to build your project and go that directory via command prompt
       C:\users\Lukshy\Project>
 ·   Type “ mvn archetype:generate -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=org.yarlithub.yschool -DartifactId=yschool” in the command prompt. 


       · Then a directory yschool (project name) has created in that folder. Go to that directory and compile the project.
      Type “mvn compile” 
      C:\users\Lukshy\Project\yschool> mvn compile

 ·  Here also the build success message displayed
 ·  Include the jetty plugin in the pom.xml file
      · Type "mvn install jetty : run” . Now the jetty will be start.
 · Now we can see the page in the browser.Go to the browser and type:   
      http://localhost:8080/yschool
·    Go to the file index.jsp along this path yschool -->src --> main --> webapp -->index.jsp and we can we can edit it. 






1 comment:

  1. Good Job .. You can be more creative though .. Give it a try on how to build and install this war into tomcat server through Maven .. and blog about it.

    ReplyDelete