viernes, enero 27, 2012

Once upon a time and long ago, I heard someone singing, Soft and low (Distant Melody - Peter Pan)




Thymeleaf Spring-MVC Maven Archetype aims to create a web application that uses Thymeleaf template engine and Spring Framework.

The main goal of Thymeleaf is to provide an elegant and well-formed way of creating HTML 5 templates. Its Standard and SpringStandard dialects allow you to create powerful natural templates, that can be correctly displayed by browsers and therefore work also as static prototypes.

You can read more about Thymeleaf at:


When you create an application using this archetype, generated web application will be composed by two html templates in WEB-INF/views, one for showing a form using HTML5 and CSS3 and another one for listing inserted data.

Spring controllers are located in controller package.

Application is internationalized too using LocaleChangeInterceptor with en_US as default locale. Properties are in src/main/resources/locale folder.

And finally server-side validation is provided by using JSR-303 provider.

Versions of used jars are:

  • Spring Framework: 3.0.5
  • Thymeleaf: 1.1.2
  • Hibernate-Validator: 4.1.0
  • Slf4j: 1.5.10
  • Servlet-api: 2.5
  • JUnit: 4.9

You can install this archetype from source or from jar file:

From source:

mvn clean install
mvn archetype:generate -DarchetypeCatalog=local

From jar:


and execute:

mvn install:install-file \ -DgroupId=com.lordofthejars \ -DartifactId=thymeleaf-spring-maven-archetype \ 
-Dversion=DOWNLOADED_VERSION \ -Dpackaging=jar 
-Dfile=PATH_TO_JAR_YOU_DOWNLOADED/thymeleaf-spring-maven-archetype-VERSION.jar


Maven repository is located at 


and source code is stored at  https://github.com/maggandalf/thymeleaf-spring-maven-archetype

For any question regarding of how to use this archetype or any issue/improvement, do not hesitate to contact me or open a new issue on github.

I wish this archetype can help you to start a new project using Thymeleaf template engine.

Music: http://www.youtube.com/watch?v=7EaGSocm5dc


2 comentarios:

  1. Thanks!

    If you used the archetype but increased the Spring version to e.g. 3+ then you'll also need an additional dependency - because they split up things in between version.

    Next to spring-webmvc additionally add spring-web:


    org.springframework
    spring-web
    ${org.springframework-version}

    ResponderEliminar