EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login
Home Software Development Software Development Tutorials Spring Tutorial Spring Boot Starter Parent
Secondary Sidebar
Spring Tutorial
  • Spring Boot
    • What is Spring Boot
    • Spring Boot flyway
    • Spring Boot framework
    • Spring Boot Logback
    • Spring Boot actuator endpoints
    • Spring Boot gRPC
    • Spring Boot jdbctemplate example
    • Spring Boot ehcache
    • Spring Boot Architecture
    • Spring Boot Port
    • Introduction of spring boot
    • Spring Boot ide
    • Spring Boot Netty
    • Spring Boot ORM
    • Spring Boot Versions
    • Spring Boot JUnit
    • Spring Boot Keycloak
    • Spring Boot gradle
    • Spring Boot Lombok
    • Spring Boot autowired
    • Spring Boot bean
    • Spring Boot hibernate
    • Spring Boot integration test
    • Spring Boot jdbc
    • Spring Boot MongoDB
    • Spring Boot postgresql
    • Spring Boot rest
    • Spring Boot swagger
    • Spring Boot thymeleaf
    • Spring Boot Unit Test
    • Spring Boot Webflux
    • Spring Boot webclient
    • Spring Boot kubernetes
    • Spring Boot Properties
    • Spring Boot Validation
    • Spring Boot Feature
    • Spring Boot Application
    • Spring Boot email
    • Spring Boot MVC
    • Spring Boot Exception Handling
    • Spring Boot Starter Parent
    • Spring Boot Docker
    • Spring Boot Logging
    • Spring Boot Query
    • Spring Boot Multiple Data Sources
    • Spring Boot Basic Authentication
    • Spring Boot Test
    • Spring Boot jwt
    • Spring Boot Liquibase
    • Spring Boot Prometheus
    • Spring Boot debug
    • Spring Boot GraalVM
    • Spring Boot Batch
    • Spring Boot controller
    • Spring Boot CLI
    • Spring Boot file upload
    • Spring Boot interceptor
    • Spring Boot Service
    • Spring Boot Configuration
    • Spring Boot Datasource Configuration
    • Spring Boot Annotations
    • Spring Boot Starter We
    • Spring Boot Actuator
    • Spring Boot DevTools
    • Spring Boot Repository
    • Spring Boot Dependencies
    • Spring Boot Path Variable
    • Spring Boot Microservices
    • Spring Boot Run Command
    • Spring Boot application.properties
    • Spring Boot Transaction Management
    • Spring Boot Banner
    • Spring Boot JPA
    • Spring Boot Change Port
    • Spring Boot RestTemplate
    • Spring Boot cors
    • Spring Boot HTTPS
    • Spring Boot OAuth2
    • Spring Boot Profiles
    • Spring Boot Interview Questions
    • Spring Boot filter
    • Spring boot logging level
    • Spring Boot Cache
    • Spring Boot Advantages
    • Spring Boot Scheduler
    • Spring Boot Initializr
    • Spring Boot Maven
    • Spring Boot Admin
    • Spring Boot Tomcat
    • Spring Boot WebSocket
    • Spring Boot Executable Jar
    • Spring Boot CommandLineRunner
    • Spring Boot DataSource
    • Spring Batch Scheduler
    • Spring Batch Example
    • Spring Batch Tasklet
    • Spring Batch Admin
    • Spring Batch
    • Spring Boot Qualifier
    • Spring Boot War
    • Spring Boot Test Configuration
  • Spring
    • What is Spring Framework?
    • Spring Architecture
    • What is Spring Integration?
    • IoC Containers
    • What is AOP?
    • Spring Modules
    • Spring Batch Processing
    • Spring Batch Partitioner
    • Spring Batch Job
    • Spring AOP
    • Spring Expression Language
    • Dependency Injection in Spring
    • Spring Batch Architecture
    • Spring framework Interview Questions
  • Spring Cloud Basics
    • What is Spring Cloud
    • Spring Cloud Contract
    • Spring Cloud Components
    • Spring Cloud Version
    • Spring Cloud Data Flow
    • Spring cloud stream
    • Spring Cloud Dependencies
    • Spring cloud microservices
    • spring cloud gateway
    • Spring Cloud Config
    • Spring Cloud Kubernetes
    • Spring Cloud Sleuth

Related Courses

Spring Boot Certification Course

Spring Framework Course Training

All in One Data Science Course

Spring Boot Starter Parent

Spring Boot Starter Parent

Introduction to Spring Boot Starter Parent

Spring boot starter parent is a special project used as a starter for applications with configurations set internally and used as default and management of any sort of dependencies required inside the spring applications. Using the boot starter parent package brings along with it many advantages such as the provision of the default configurations for your spring application, simplifying the building process as it creates a tree of dependencies which makes it easy to manage. It also comes up with other configurations which can be treated as a default for various plugins in Maven. Some of the maven plugins include the maven jar plugin, maven war plugin, maven failsafe plugin and maven surefire plugin for which default configurations are provided. Along with that, the starter parent also comes along with functionality to inherit the management of dependencies from the spring-boot-dependencies package which is internally the spring boot starter parent’s parent.

In this article, we will have a look at how we can use it in our project along with the help of some examples.

How to use it?

It is very easy to download or find the latest version and add it to our project. You can find its latest version inside the maven central using this link. In the above link, you can observe all the available versions as shown below –

String boot starter parent 1

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

https://search.maven.org/classic/#search%7Cga%7C1%7Ca%3A%22spring-boot-starter-parent%22

After choosing your required version, you will find the apache maven dependency tag as shown the below image.

All in One Software Development Bundle(600+ Courses, 50+ projects)
Python TutorialC SharpJavaJavaScript
C Plus PlusSoftware TestingSQLKali Linux
Price
View Courses
600+ Online Courses | 50+ projects | 3000+ Hours | Verifiable Certificates | Lifetime Access
4.6 (86,754 ratings)

String boot starter parent 2

https://search.maven.org/classic/#artifactdetails%7Corg.apache.servicecomb%7Cspring-boot-starter-parent%7C1.3.5%7Cpom

You can also see the corresponding pom.xml file. If you already have the pom.xml file in your project, you can copy the dependency information in the apache maven section shown in the highlighted manner and paste this set of tags in your pom.xml file.

Managing Dependencies –

After declaring the starter parent of spring boot inside our project, we are free to declare any of the dependency tags for pulling any required dependencies from the parent easily. One more advantage of having this functionality is that we have the privilege of not defining the versions of the required dependencies as it is the responsibility of the maven to refer to the versions defined in the parent tag of the starter parent and download the corresponding jar files. In order to understand it better, let us take one example where we will be building a web project in which we will try to add the dependency of spring boot starter web directly without specifying its version. For that, we will be making the use of following code snippet –

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>

Adding dependency using Dependency Management tag –

We can provide explicitly different versions of the dependency that we are adding by specifying it in the dependency Management tag. This helps in specifying any different version of the dependency from the default version specified. For example, if we need to add the dependency of spring boot starter data jpa having version 3.2.2 then, we can make the use of the following dependency tag in pom.xml.

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>3.2.2</version>
</dependency>
</dependencies>
</dependencyManagement>

Properties of starter parent –

We can declare the properties and their value that we need to change in the properties section provided if we want to assign any other value than the one mentioned inside the starter parent.

We can easily have control of changing the configurations by simply changing the properties because internally, the spring boot dependencies which is its parent makes the use of the properties for handing the configurations of maven plugin, java versions and other dependencies version.

Suppose that we have to change the version of some dependency which has a value other than that mentioned in the starter parent, then we can simply configure its property and add the dependency using the dependency tag shown below –

<properties>
<junit.version>3.18</junit.version>
</properties>

Note –
We can also have a project without a spring boot starter parent in it. This scenario mostly occurs when we manually have to mention the configurations of maven or we have a customized parent of maven.

Example

Firstly let us observe the contents of the default dependencies and the corresponding version in the following configuration file of pom.xml –

<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd;
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${revision}</version>
<relativePath>../../spring-boot-dependencies</relativePath>
</parent>
<artifactId>spring-boot-starter-parent</artifactId>
<packaging>pom</packaging>
<name>Spring Boot Starter Parent</name>
<description>Parent pom providing dependency and plugin management for applications
built with Maven</description>
<properties>
<java.version>1.8</java.version>
<resource.delimiter>@</resource.delimiter> <!-- delimiter that doesn't clash with Spring ${} placeholders -->
...
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
...
</project>

For a complete reference of the configuration pom.xml file of spring boot, starter parent refers this link.
We can observe that the spring boot starter parent has the parent of spring boot dependencies and all the properties, resources and other dependencies and their corresponding properties are mentioned there. Now, suppose we want to change the property of JDBC whose default version specified by the spring boot starter parent is 5.2.12 as shown below and we want to use the version of 5.3.3 JDBC in our project.

<jdbc.version>5.2.12</jdbc.version>

Now we can change the version specified in the spring boot starter parent of JDBC dependency by using the following property tag in our project’s pom.xml file –

<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdbc.version>5.3.3 </jdbc.version>
</properties>

You can confirm the change of the version by going to your eclipse editor and checking the message when you navigate your mouse pointer over the dependency tag of JDBC. By using the above way, we can specify explicitly any version that we want in our project for any of the dependencies other than the one specified in the spring boot starter parent.

Conclusion

The spring boot starter parent is a dependency management tool and makes the specification of the versions of the dependencies of maven, java and also plugins easier by providing default versions. It provides the default configurations when used as a parent in any of the child projects. We can also override the properties easily by specifying the tags in our pom.xml file of the project.

Recommended Articles

This is a guide to Spring Boot Starter Parent. Here we discuss Introduction, How to use it, examples with code implementation for better understanding. You may also have a look at the following articles to learn more –

  1. Spring Boot Exception Handling
  2. Spring Boot Logging
  3. Spring Boot cors
  4. Spring Boot Batch
Popular Course in this category
Spring Boot Training Program (2 Courses, 3 Project)
  2 Online Courses |  3 Hands-on Projects |  22+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course

Related Courses

Spring Framework Training (4 Courses, 6 Projects)4.9
All in One Data Science Bundle (360+ Courses, 50+ projects)4.8
0 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Software Development Course

C# Programming, Conditional Constructs, Loops, Arrays, OOPS Concept

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more