InterviewSolution
| 1. |
Explain Spring Boot Starter Parent. |
|
Answer» When you generate a Spring Boot Project, you will see following inside your pom.xml file: <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 :
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. |
|