Skip to content
A sample web application built on MyBatis 3, Spring Boot and Thymeleaf 3 using CovenantSQL as underlying storage.
Branch: master
Clone or download
Pull request Compare This branch is 1 commit ahead, 7 commits behind kazuki43zoo:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Build Status Codacy Badge Coverage Status

This sample is a web application built on MyBatis, Spring Boot(Spring MVC, Spring Security) and Thymeleaf. This is another implementation of MyBatis JPetStore sample application (

Original application is available for downloading in the downloads section of MyBatis project site. In this section, we will walk through this sample to understand how is it built and learn how to run it.


This sample application is under development. If you found an issue, please report from here.


The Demo application is running on the Pivotal Web Services. Let's play on


  • Java 8+ (JDK 1.8+)


  • MyBatis Spring Boot Starter 2.0 (MyBatis 3.5, MyBatis Spring 2.0) SNAPSHOT version
  • Spring Boot 2.1 (Spring Framework 5.1, Spring Security 5.1)
  • Thymeleaf 3.0
  • Hibernate Validator 6.0 (Bean Validation 2.0)
  • HSQLDB 2.4 (Embed Database)
  • Flyway 5.2 (DB Migration)
  • Tomcat 9.0 (Embed Application Server)
  • Groovy 2.4 (Use multiple line string on MyBatis Mapper method)
  • Lombok 1.18
  • Selenide 5.1
  • Selenium 3.14
  • etc ...

Run using Maven command

  • Clone this repository

    $ git clone
  • Run a web application using the spring-boot-plugin

    $ cd mybatis-spring-boot-jpetstore.git
    $ ./mvnw clean spring-boot:run

Run using java command

  • Build a jar file

    $ ./mvnw clean package -DskipTests=true
  • Run java command

    $ java -jar target/mybatis-spring-boot-jpetstore-2.0.0-SNAPSHOT.jar

Perform integration test using Maven command

Perform integration tests for screen transition.

$ ./mvnw clean test

Run on IDEs (Note)

This sample use the Lombok to generate setter method, getter method and constructor. If this sample application run on your IDE, please install the Lombok. (see

And this application use the groovy language to use multiple line string on MyBatis Mapper method. If this sample application run on your IDE, please convert to groovy project and add src/main/groovy into source path. And if you use a STS(or Eclipse), please install the Groovy Eclipse plugin. About how install the Groovy Eclipse, please see as follow:

e.g.) multiple line string on MyBatis Mapper method

interface CategoryMapper {

            CATID AS categoryId,
            DESCN AS description
            CATID = #{categoryId}
    Category getCategory(String categoryId)


Access to the index page


Index Screen

Catalog Screen

Default active accounts (ID/PASSWORD)

  • j2ee/j2ee

Data Store

In this application, application data stored in filesystem files.

  └── db
      + jpetstore.script

Project Structure

Project structure of this sample application is as follow:

└── src
    └── main
        ├── groovy
        │   └── com
        │       └── kazuki43zoo
        │           └── jpetstore
        │               └── mapper         // Store mapper interfaces
        ├── java
        │   └── com
        │       └── kazuki43zoo
        │           └── jpetstore
        │               ├── component      // Store general component classes
        │               │   ├── event
        │               │   ├── exception
        │               │   ├── message
        │               │   └── validation
        │               ├── config         // Store configuration classes
        │               ├── domain         // Store domain objects
        │               ├── service        // Store service classes
        │               └── ui             // Store classes that depends user interface
        │                   └── controller // Store controller classes
        └── resources
            ├── db                         // Store sql files for Flyway
            │   └── migration
            ├── static                     // Store static web resource files
            │   ├── css
            │   └── images
            └── templates                  // Store view template files for Thymeleaf
                ├── account
                ├── auth
                ├── cart
                ├── catalog
                ├── error
                └── order
You can’t perform that action at this time.