Maven 3 Archetype for Project With Spring, Spring MVC, Hibernate, JPA

user1888243 picture user1888243 · Jan 30, 2013 · Viewed 102.9k times · Source

I'm trying to use Maven 3 to create a project which uses Spring 3, Spring MVC, Hibernate 4, and JPA. However, when I execute:

mvn archetype:generate

Non of the archetypes listed include all of these; and even those which are close seem to be special projects such as projects with Flex. I want to avoid having extra modules such as Flex that would crowd the project and configuration files. So, is there an archetype for Maven 3 that I can use to create such a project?

Answer

AzizSM picture AzizSM · Aug 5, 2013

A great Spring MVC quickstart archetype is available on GitHub, courtesy of kolorobot. Good instructions are provided on how to install it to your local Maven repo and use it to create a new Spring MVC project. He’s even helpfully included the Tomcat 7 Maven plugin in the archetypical project so that the newly created Spring MVC can be run from the command line without having to manually deploy it to an application server.

Kolorobot’s example application includes the following:

  • No-xml Spring MVC 3.2 web application for Servlet 3.0 environment
  • Apache Tiles with configuration in place,
  • Bootstrap
  • JPA 2.0 (Hibernate/HSQLDB)
  • JUnit/Mockito
  • Spring Security 3.1