Maven 3 Archetype for Project With Spring, Spring MVC, Hibernate, JPA
Asked Answered
T

4

19

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?

Tomato answered 29/1, 2013 at 23:53 Comment(1)
possible duplicate of Is there a maven 2 archetype for spring 3 MVC applications?Swingle
R
12

Possible duplicate: Is there a maven 2 archetype for spring 3 MVC applications?

That said, I would encourage you to think about making your own archetype. The reason is, no matter what you end up getting from someone else's, you can do better in not that much time, and a decent sized Java project is going to end up making a lot of jar projects.

Rewrite answered 30/1, 2013 at 1:30 Comment(0)
L
21

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
Lenora answered 5/8, 2013 at 1:22 Comment(2)
I should think the inclusion of thymeleaf, bootstrap, and mongodb in the configuration goes against the declaration that the OP wants to "avoid having extra modules".Married
Why should somebody use the spring mvc archetype in the first place?Elsey
R
12

Possible duplicate: Is there a maven 2 archetype for spring 3 MVC applications?

That said, I would encourage you to think about making your own archetype. The reason is, no matter what you end up getting from someone else's, you can do better in not that much time, and a decent sized Java project is going to end up making a lot of jar projects.

Rewrite answered 30/1, 2013 at 1:30 Comment(0)
V
4

Take a look at http://start.spring.io/ it basically gives you a kick starter with either maven or gradle build.

Note: This is a Spring Boot based archetype.

Voltaic answered 9/4, 2014 at 18:14 Comment(0)
A
1

With appFuse framework, you can create an Spring MVC archetype with jpa support, etc ...

Take a look at it's quickStart guide to see how to create an archetype based on this Framework.

Foundational frameworks in AppFuse:

  • Bootstrap and jQuery
  • Maven, Hibernate, Spring and Spring Security
  • Java 7, Annotations, JSP 2.1, Servlet 3.0
  • Web Frameworks: JSF, Struts 2, Spring MVC, Tapestry 5, Wicket
  • JPA Support

For example to create an appFuse light archetype :

mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes 
-DarchetypeArtifactId=appfuse-light-struts-archetype -DarchetypeVersion=2.2.1 
-DgroupId=com.mycompany -DartifactId=myproject
Albion answered 15/1, 2014 at 21:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.