Continuous Integration: Java Spring Boot project with Travis

Miguel Martínez Serrano
2 min readFeb 14, 2021

Compile and test your code on every change you commit is a good start point to develop high quality software. Iterate over stable software, write good tests and fix the bugs. This is the way.

Continuous integration can help you in this path looking to minimize headaches and maximizing quality code.

Travis CI dashboard with branches with builds passings tests

In this example we’ll setup the minimal configuration of a Java Spring Boot with Maven and Travis CI. I’ll use a sample repository from my github: bank-api.

  1. Go to and login with GitHub/GitLab account.

2. In your Git repository add the travis configuration file .travis.yml

Explanation of the file:

  • language: java
  • jdk: we’re using oraclejdk11
  • script: the command we want to run
  • before_install: the maven wrapper must be executed in the Travis environment, so we need to update the permissions before the script runs

3. Git commit and push the file to the repository.

Important: the Maven wrapper folder .mvn must be included in the repository (check if it’s excluded from .gitignore file).

4. We can go to the Travis CI dashboard and check the build execution results

My public Travis-CI

Now you can add the Travis CI badge to the readme, isn’t it cool? :P

  • Click on the badge next to the project in
  • Select the branch, “Markdown” format, copy the result and paste on the
Badge image markdown format
Travis build badge at

Twitter: @miguelms_es

If you want to contact:



Miguel Martínez Serrano

Software Engineer | University of Oviedo | Video post-production | Music production | Social Media