Chapter 2. Choosing Your Tools and Getting Started

Getting started creating Spring Boot apps is easy, as you’ll soon see. The most difficult part might be deciding which of the available options you’d like to choose.

In this chapter, we’ll examine some of the excellent choices you have available to create Spring Boot applications: build systems, languages, toolchains, code editors, and more.

Maven or Gradle?

Historically, Java application developers have had a few options for project build tools. Some have fallen out of favor over time—for good reason—and now we’ve coalesced as a community around two: Maven and Gradle. Spring Boot supports both with equal aplomb.

Apache Maven

Maven is a popular and solid choice for a build automation system. It has been around for quite some time, having had its beginning in 2002 and becoming a top-level project at the Apache Software Foundation in 2003. Its declarative approach was (and is) conceptually simpler than the alternatives of the time and of now: simply create an XML-formatted file named pom.xml with desired dependencies and plug-ins. When you execute the mvn command, you can specify a “phase” to complete, which accomplishes a desired task like compiling, removing prior output(s), packaging, running an application, and more:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
 https://maven.apache.org/xsd/maven-4.0.0.xsd" ...

Get Spring Boot: Up and Running now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.