Konubinix' opinionated web of thoughts

Use a Spring Boot Application as a Dependency


Spring Boot Reference Guide

Like a war file, a Spring Boot application is not intended to be used as a dependency. If your application contains classes that you want to share with other projects, the recommended approach is to move that code into a separate module. The separate module can then be depended upon by your application and other projects.

plugins must be configured to produce a separate artifact that is suitable for use as a dependency

a classifier must be specified

To configure a classifier of exec in Maven, you can use the following configuration:

<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <classifier>exec</classifier> </configuration> </plugin> </plugins> </build>