1.

Explain Spring Boot Starter Parent.

Answer»

When you generate a Spring Boot Project, you will see following inside your pom.xml file:

   &LT;parent>         <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-starter-parent</artifactId>         <version>2.1.6.RELEASE</version>     </parent>

This is reference to default Spring Boot Starter or parent Spring Boot Starter. You can use multiple child Projects using the configuration from this. This Starter gives you for free Configuration ( For example,Java Version) , Version of Dependencies ( Dependency MANAGEMENT) and default configuration for plugin.

With parent Project, you get the following features : 

  • Default Compiler Level for Java Version.
  • Plugin configuration (exec plugin, Git commit ID, and shade).
  • UTF-8 SOURCE encoding.
  • A Dependency Management section: This is coming from spring-boot-dependencies pom, that manages the versions of common dependencies.
  • Resource filtering.
  • Resource filtering for application.properties and application.yml including environment-specific files (for example, application-dev.properties and application-dev.yml).

Spring Boot Starter Parent has spring-boot-dependencies as the parent pom. It inherits dependency management from spring-boot-dependencies.

   <parent>         <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-dependencies</artifactId>         <version>2.0.4.RELEASE</version>         <relativePath>../../spring-boot-dependencies</relativePath>     </parent>

Minimum Java version is 8 with Spring 2. 

You Can configure the VARIOUS properties/configuration as under :

<properties>         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>         <java.version>1.8</java.version>         <resource.delimiter>@</resource.delimiter>         <maven.compiler.source>1.8</maven.compiler.source>         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>         <maven.compiler.target>1.8</maven.compiler.target>    </properties>

Spring Boot Starter Parent specifies the default configuration for a host of plugins including maven-failsafe-plugin, maven-jar-plugin, maven-surefire-plugin, and maven-war-plugin ETC.



Discussion

No Comment Found