I have a problem with a Multi-Module Spring-Boot Application.
I have one Module that I use for Services, the core-Module. And one module for View-Related Classes, the web-Module. The are both in a parent-Module, where I add the dependencies, like the "spring-boot-starter" and that can be used by both modules.
Now to the problem:
I want to run the web-Module with the embedded Tomcat and have the core-Module as a dependency in the web-module.
In other Spring projects I would just include the maven-jar-plugin and create a jar of the core-Module.
The problem in this Spring-Boot project is that the maven-jar-plugin is already configured, in the "spring-boot-starter". And it needs a mainClass, which only the web-module has.
Small excerpt from the "spring-boot-starter"-POM
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>${start-class}</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
Is there a way to package the core-Module as a JAR without needing a "start-class" in that module?
spring boot non executable jar
, you will find Create a non-executable JAR with exclusions in the Spring Boot documentation. – Andreas