From 3b96f5b3fcbf84d1b48179bfe209b0ebfe0b3edd Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 21 Aug 2015 18:16:33 +0200 Subject: [PATCH 1/1] Simple Spring/Thymeleaf-App This app only serves static content. We do not need dynamic content to demonstrate the integration, but you could easily extend this sample to serve dynamically rendered pages. --- .gitignore | 1 + pom.xml | 196 ++++++++++++++++++ src/main/resources/log4j.xml | 28 +++ src/main/resources/spring/mvc.xml | 71 +++++++ src/main/webapp/WEB-INF/web.xml | 62 ++++++ src/main/webapp/thymeleaf/a.html | 35 ++++ src/main/webapp/thymeleaf/b.html | 35 ++++ src/main/webapp/thymeleaf/c.html | 35 ++++ src/main/webapp/thymeleaf/index.html | 35 ++++ .../webapp/thymeleaf/templates/layout.html | 87 ++++++++ .../maven-grunt-integration.properties | 1 + 11 files changed, 586 insertions(+) create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/resources/log4j.xml create mode 100644 src/main/resources/spring/mvc.xml create mode 100644 src/main/webapp/WEB-INF/web.xml create mode 100644 src/main/webapp/thymeleaf/a.html create mode 100644 src/main/webapp/thymeleaf/b.html create mode 100644 src/main/webapp/thymeleaf/c.html create mode 100644 src/main/webapp/thymeleaf/index.html create mode 100644 src/main/webapp/thymeleaf/templates/layout.html create mode 100644 src/test/resources/maven-grunt-integration.properties diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb5a316 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..3cb5566 --- /dev/null +++ b/pom.xml @@ -0,0 +1,196 @@ + + + 4.0.0 + + + de.juplo + maven-grunt-integration + Juplo - Example Integration of Maven and Grunt + 0.1 + war + http://www.juplo.de/maven-grunt-integration + + + + 3.0.0 + + + + + scm:git:http://juplo.de/git/maven-grunt-integration + scm:git:ssh://juplo.de:/var/lib/git/juplo/maven-grunt-integration + http://juplo.de/gitweb/?p=maven-grunt-integration;a=summary + + + + + + kai + Kai Moritz + kai@juplo.de + + + + + + + + UTF-8 + + + 3.1.0 + 1.7.12 + 4.2.0.RELEASE + 2.1.4.RELEASE + 1.2.9 + + + + + + + + + org.springframework + spring-webmvc + ${springframework.version} + + + + + org.thymeleaf + thymeleaf + ${thymeleaf.version} + runtime + + + org.thymeleaf + thymeleaf-spring4 + ${thymeleaf.version} + runtime + + + nz.net.ultraq.thymeleaf + thymeleaf-layout-dialect + ${thymeleaf-layout-dialect.version} + runtime + + + + + javax.servlet + javax.servlet-api + ${servlet-api.version} + provided + + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + slf4j-log4j12 + ${slf4j.version} + runtime + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + runtime + + + + + + + + juplo.internal + Internal Release Repository + http://juplo.de/archiva/repository/internal/ + + + juplo.snapshots + Internal Snapshot Repository + http://juplo.de/archiva/repository/snapshots/ + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + 1.7 + 1.7 + utf8 + true + + + + org.apache.maven.plugins + maven-source-plugin + 2.4 + + + attach-sources + verify + + jar + + + + + + org.eclipse.jetty + jetty-maven-plugin + 9.2.13.v20150730 + + true + + + + + + + + + + org.apache.maven.plugins + maven-changes-plugin + 2.11 + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.3 + + + org.apache.maven.plugins + maven-jxr-plugin + 2.5 + + + org.apache.maven.plugins + maven-surefire-report-plugin + 2.18.1 + + + org.apache.maven.plugins + maven-scm-plugin + 1.9.4 + + install + + + + + + diff --git a/src/main/resources/log4j.xml b/src/main/resources/log4j.xml new file mode 100644 index 0000000..a3d7d44 --- /dev/null +++ b/src/main/resources/log4j.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/spring/mvc.xml b/src/main/resources/spring/mvc.xml new file mode 100644 index 0000000..3504d43 --- /dev/null +++ b/src/main/resources/spring/mvc.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + /thymeleaf/**=staticResources + /*.html=urlFilenameViewController + /**/*.html=urlFilenameViewController + + + + + + + + + /thymeleaf/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..92eae0e --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,62 @@ + + + + maven-grunt-integration + + + + + contextConfigLocation + + classpath:/spring/mvc.xml + + + + + org.springframework.web.context.ContextLoaderListener + + + + + + + characterEncodingFilter + org.springframework.web.filter.CharacterEncodingFilter + + encoding + UTF-8 + + + forceEncoding + true + + + + + characterEncodingFilter + /* + + + + + + + Dispatcher Servlet - Maven/Grunt-Integration + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + + + + 1 + + + + Dispatcher Servlet - Maven/Grunt-Integration + / + + + diff --git a/src/main/webapp/thymeleaf/a.html b/src/main/webapp/thymeleaf/a.html new file mode 100644 index 0000000..76533cf --- /dev/null +++ b/src/main/webapp/thymeleaf/a.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + Maven/Grunt-Integration - A + + + + + + +
+

A

+

Content of page A.

+
+ +

Menu for page A

+ + + + + + diff --git a/src/main/webapp/thymeleaf/b.html b/src/main/webapp/thymeleaf/b.html new file mode 100644 index 0000000..845d855 --- /dev/null +++ b/src/main/webapp/thymeleaf/b.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + Maven/Grunt-Integration - B + + + + + + +
+

B

+

Content of page B.

+
+ +

Menu for page B

+ + + + + + diff --git a/src/main/webapp/thymeleaf/c.html b/src/main/webapp/thymeleaf/c.html new file mode 100644 index 0000000..e75b678 --- /dev/null +++ b/src/main/webapp/thymeleaf/c.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + Maven/Grunt-Integration - C + + + + + + +
+

C

+

Content of page C.

+
+ +

Menu for page C

+ + + + + + diff --git a/src/main/webapp/thymeleaf/index.html b/src/main/webapp/thymeleaf/index.html new file mode 100644 index 0000000..20b58d8 --- /dev/null +++ b/src/main/webapp/thymeleaf/index.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + Maven/Grunt-Integration + + + + + + +
+

Home

+

Content of page home.

+
+ +

Menu for page Home

+ + + + + + diff --git a/src/main/webapp/thymeleaf/templates/layout.html b/src/main/webapp/thymeleaf/templates/layout.html new file mode 100644 index 0000000..db23fa2 --- /dev/null +++ b/src/main/webapp/thymeleaf/templates/layout.html @@ -0,0 +1,87 @@ + + + + + + + + + + Layout-Template + + + + + +
+

yourSHOUTER - Startseite

+
+ + +
+
+ + +
+ +
+

Layout-Template

+

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. +

+

Duis aute irure dolor

+
    +
  • Operators and other mathematical stuff: -+/*
  • +
  • + Characters offten used in programming languages: + {(<>)}@$?%*#;:&/\!^"'`~ +
  • +
  • Special german characters: ÄäÖöÜü
  • +
  • Other special characters: @?¢§%°
  • +
+

Excepteur sint occaecat cupidatat

+

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, + sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. +

+

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. + Ut enim ad minim veniam, quis nostrud exercitation + ullamco laboris nisi ut aliquip ex ea commodo consequat. + Duis aute irure dolor in reprehenderit in voluptate velit esse + cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat + cupidatat non proident, sunt in culpa qui officia deserunt mollit + anim id est laborum. +

+
+ +
+ + + + + + diff --git a/src/test/resources/maven-grunt-integration.properties b/src/test/resources/maven-grunt-integration.properties new file mode 100644 index 0000000..8b23fdf --- /dev/null +++ b/src/test/resources/maven-grunt-integration.properties @@ -0,0 +1 @@ +maven-grunt-integration.cacheable=false -- 2.20.1