In this tutorial, we are going to see about Spring boot starters. This is part of Spring boot tutorial series.
Dependency management is one of the critical tasks while working on any project. You want to create a new spring project with JPA capabilities. Do you know what dependencies you need to include? You might go to web, copy dependencies from the sample project and use it in the project
Spring boot starters solve the exactly same problem. Starters are a set of convenient dependency descriptors that you can use to bootstrap your spring applications.
Spring boot starters contain a lot of predefined dependencies with supported set of transitive dependencies.
Spring boot starters naming convention
All Spring boot starters follow the same naming convention for easy search.All the starters start with spring-boot-starter-* .
For example:
Name of JPA starter is spring-boot-starter-data-jpa
List of popular Spring boot JPA starter
[table id=12 /]
Spring boot starters example
Let’s say you want to create a project which supports ActiveMQ operations. You just need to add below POM entry apart from parent pom.
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
</dependencies>
Here is complete pom.xml for Spring boot ActiveMQ project.
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.arpit.java2blog</groupId>
<artifactId>SpringBootActiveMQExample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
<relativePath />
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
</dependencies>
<build>
<finalName>SpringBootActiveMQExample</finalName>
</build>
</project>
If you can refer working example of Spring boot ActiveMQ example.