Skip to content

Guide · Open source

How to use spring-boot-demo: clone, import into IDEA and run

Updated · written with AI from the project's own documentation and checked against our catalogue data

spring-boot-demo is an open-source collection of runnable Spring Boot example projects, written in Java and released under the MIT licence. It is aimed at developers and students who want to see how individual Spring Boot features are integrated. By the end of this guide you will be able to clone the repository, import it into IntelliJ IDEA, and run a single demo module on its own.

Spring Boot Demoxkcoding/spring-boot-demo · ★ 34.1k · MIT

Quick start

  1. 1Install the prerequisites. Install JDK 1.8 or newer, Maven 3.5 or newer and IntelliJ IDEA. Add the lombok plugin to IDEA.
  2. 2Clone the repository. Run the git clone command for xkcoding/spring-boot-demo.
  3. 3Open the project in IDEA. Open the cloned folder in IntelliJ IDEA.
  4. 4Import the Maven project. In the Maven Projects panel, import the pom.xml in the project root.
  5. 5Run a demo module. Find the Application class of the module you want and run it.
  6. 6Prepare the database if needed. For database demos, set up MySQL 5.7 or newer and initialise the data described in that module's README.

What is spring-boot-demo?

The README describes the project as a way to learn and practise Spring Boot in depth. It contains 66 integration demos, 55 of which are finished. Topics include logging, template engines, ORMs, Redis caching, scheduled tasks, message queues and Docker.

Each module is a separate small project that you can open and run on its own. The repository's README is written in Chinese, with an English version linked from it.

  • Covers logback, template engines (Freemarker, Thymeleaf, Beetl, Enjoy), ORMs (JPA, MyBatis, MyBatis-Plus, BeetlSQL), Redis and ehcache caching, and task scheduling (task, Quartz, xxl-job).
  • Includes RabbitMQ and Kafka for message queues, and a Docker demo for containerisation.

What do you need before you start?

The README lists the development environment below. Install these before cloning the project.

The README says to use IntelliJ IDEA and to install the Lombok plugin. MySQL is only needed for the database demos.

  • JDK 1.8 or newer
  • Maven 3.5 or newer
  • IntelliJ IDEA with the lombok plugin installed
  • MySQL 5.7 or newer, for database demos

Clone the repository and open it in IDEA

Clone the repository with git, then open the cloned folder in IntelliJ IDEA. The README's first two steps are shown below.

In IDEA, import the root pom.xml file from the Maven Projects panel. If you cannot see that panel, enable View, then Tool Buttons in the top toolbar, and it will appear on the right side of the window.

git clone https://github.com/xkcoding/spring-boot-demo.git

Run a single demo

Each module has its own Application class. Find the module you want to study and run its Application class from IDEA.

Read the README inside each demo folder before running it. Some demos need database data to be initialised first, so check that step too.

  • Example modules include demo-helloworld, demo-orm-mybatis, demo-cache-redis and demo-task-quartz.
  • Check the module's own README for setup steps such as database initialisation.

Which branch should you use?

The master branch is based on Spring Boot 2.1.0.RELEASE, and each module's parent is the pom.xml in the root directory. The v-1.5.x branch is based on Spring Boot 1.5.8.RELEASE, but the README says it is no longer maintained and that its content is gradually moving to master.

If you are a beginner, the README suggests using master because it is easier to run than the 1.5.x branch.

What people use it for

  • Study how MyBatis, MyBatis-Plus or JPA is wired into a Spring Boot project by running the matching demo.
  • Compare ORM or task-scheduling options side by side, such as task, Quartz and xxl-job.
  • Find a working example of a specific integration, such as Redis caching or RabbitMQ messaging, to use as a reference.
  • Work through the demos as a hands-on course alongside a Spring Boot tutorial.

Frequently asked questions

Is spring-boot-demo free to use?

The project is released under the MIT licence, as shown in the repository badge. Check the LICENSE file in the repository for the full terms.

What do I need to run spring-boot-demo?

The README lists JDK 1.8 or newer, Maven 3.5 or newer, IntelliJ IDEA with the lombok plugin, and MySQL 5.7 or newer for the database demos.

Can I use spring-boot-demo in production?

The README describes it as a learning project, so it is not a production-ready application template. Use it as a reference for individual integrations.

Which Spring Boot version does it use?

The master branch is based on Spring Boot 2.1.0.RELEASE. The v-1.5.x branch uses 1.5.8.RELEASE and the README says it is no longer maintained.

Why can't I see the Maven Projects panel in IDEA?

The README says to enable View, then Tool Buttons in the top toolbar. The Maven Projects panel will then appear on the right side of IDEA.

What are similar projects to spring-boot-demo?

The repository's README mentions JustAuth, Mica, SpringBlade and awesome-collector as related open-source projects. spring-petclinic is a comparable Spring Boot sample project.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

spring-boot-demo suits Java developers and students who want working, separate examples of specific Spring Boot integrations such as MyBatis, Redis or task scheduling. It is not suited to people new to Java and Spring, since the README assumes Maven and IntelliJ IDEA knowledge, nor to teams needing a production-ready starting point or the newest Spring Boot version.

Install options & downloads