I am new with Spring Boot and failed to create a self-contained executable jar. The Maven created jar fails to detect the Beans that it needs at runtime.
Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
I checked the factory if an implementation of the factory is in the jar which is the case. I also carefully checked other posts and made sure that the Spring Boot annotation is in place. It includes the @ComponentScan and others.
@SpringBootApplication
public class InitService {
I assume that my pom has the dependencies correctly set, because the application runs well when I start it from my Eclipse project.
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>de.newbe.create.InitService</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
So now I challenge the community and hope for your valuable expertise and support. Thanks in advance!