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
For more information on the tests, see this page
- 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.
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
To test your application running in a production environment, type
java -Dspring.profiles.active=production -jar target\spring-boot-thymeleaf-1.0.jar