Sunday, November 25, 2012

Maven Web project & Apache Tomcat

In this topic I am going to create a test web project with maven and deploying going to deploy it on tomcat.


  • Open Eclipse go to File then New  -> Other.. -> Maven Project (In my example name of test project is maven.work)

  • Choose  maven archetype web


  • The enter Group id and Artifact id and finish.

  • The go to File again then Other.. -> Server -> Choose server.
  • Apache Tomcat in our example.




  • Right click the project and go to Properties -> Java Build Path -> Libraries.

  • Then Add Library.
  • Add JRE System Library.
  • Then Add Server Runtime. Choose Apache tomcat 6.
  
  • Add Index.jsp in src/webapp/
  • To deploy project right click project and go to Maven -> Update Project.
  • Then Right Click Project and go to Run AS and then install
  • Then Right Click Project and go to Run AS -> Build -> On dialog go to goal field and the go to Goal and the enter tomcat:run.