Skip to content

rschellius/spring-mvc-library

Repository files navigation

Avans Spring Library Worked Example

Build Status

About

This is a worked example of a library case that is used at Avans Hogeschool in Breda, Netherlands. Some of the content in the app is in Dutch.

It uses the following technologies:

  • Spring Boot MVC with Maven
  • Thymeleaf templating engine with Java 8 Time
  • MySql database using plain old SQL queries, so without JPA/Hibernate.
  • WebJars for css and js includes
  • maven-git-commit-id-plugin to display Git commit info in our Spring application footer
  • Swagger to describe the (minimal) REST API
  • MockMVC tests
  • Travis CI for automatic test CI

When its running

screenprint of the application

Tests

For more information on the tests, see this page

Prerequisites

  • JDK 8 and JAVA_HOME environment variable set
  • Maven installed and configured
  • MySql database with library.sql script imported and running on local host (when running the app locally)
  • Importing the .sql script should provide a user 'spring' with pwd 'test' and access to the 'library' database.

Building the project

Clone the repository: open a command prompt and type:

git clone [url to this repo]

Navigate to the newly created folder:

cd spring-boot-thymeleaf

Run the project with:

mvn clean compile spring-boot:run

To package the project into a fat jar run:

mvn clean package

To test the project run:

mvn clean compile test

Production Environment

To test your application running in a production environment, type

java -Dspring.profiles.active=production -jar target\spring-boot-thymeleaf-1.0.jar

Referenced articles:

Releases

No releases published

Packages

No packages published

Languages