Adding Spring boot application as a dependency to another spring boot application
The Spring Boot Maven and Gradle plugins both package our application as executable JARs – such a file can't be used in another project since class files are put into BOOT-INF/classes . This is not a bug, but a feature. In order to share classes with another project, the best approach to take is to create a separate jar containing shared classes , then make it a dependency of all modules that rely on them. But if that isn't possible, we can configure the plugin to generate a separate jar that can be used as a dependency. Suppose we have two projects 1- general_definitions_app 2- cutstomer_service_app we want to add "general_definitions_app" as a dependency to "cutstomer_service_app" Steps: 1- open general_definitions_app , then open the pom.xml file 2- serach for the plugin "spring-boot-maven-plugin" and modify it to be <build> <plugins> <plugin> ...