eclipsespringhibernatetomcatmaven

Deploy Maven project with Spring+Hibernate to Tomcat


I have created a Spring 3 + Hibernate project using Maven in Eclipse. How can I deploy my project to a Tomcat server using Maven.

Help is highly appreciated.


Solution

  • Adding to what @Sean Patrick Floyd and @Michael Borgwardt had already suggested, If you are using Eclipse, you can also follow this to generate your .war file.

    I assume the project is Maven enabled, Else:

    • Right click on your project -> Select Maven -> Select Enable Dependency Management.

    To generate the .war:

    • Right click on your project -> Select Run As -> Select Maven Package.

    This will generate a war file into target directory located in your project.

    To deploy to Tomcat:

    • Copy the generated war file to your webapps directory in Tomcat.