1.

Explain the use of Spring Boot Maven plugin?

Answer»

Spring Boot eases QUICK starting a new feature from an application DEVELOPMENT POINT of view. However, what about building, packaging and other life CYCLE steps of your Spring Boot application. Here, Spring Boot maven plugin comes to your rescue. 

<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.1.6.RELEASE</version> <executions> <execution> <goals> <goal>REPACKAGE</goal> </goals> </execution> </executions> </plugin> </plugins> </build>

It helps to collect all the jars on the classpath and builds a single, runnable jar ", which makes it more convenient to execute and transport your service.

It searches for the public static void main() method to flag as a runnable class.

The Spring Boot Plugin has the following goals.

  • spring-boot:run: This is for running your Spring Boot application.
  • Spring-boot:repackage: This is for repackaging your jar/war to be executable.
  • spring-boot:start and spring-boot:stop: This can be used for Integration tests.
  • spring-boot:build-info: This generates build information that can be used by the Actuator.


Discussion

No Comment Found