且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Spring Boot Web服务器在Eclipse中工作正常,无法在Server上启动:缺少EmbeddedServletContainerFactory bean

更新时间:2022-02-04 23:32:19

答案是... 不要使用maven-assembly-plugin.在文档,我们看到Spring为此制作了自己的插件spring-boot-maven-plugin.更改pom.xml以删除maven-assembly-plugin并改为使用:

And the answer is ... Don't use the maven-assembly-plugin. Reading further on in the documentation, we see that Spring has made their own plugin for this, the spring-boot-maven-plugin. Changing the pom.xml to remove the maven-assembly-plugin and use instead:

    <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <executions>
            <execution>
                <goals>
                    <goal>repackage</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

解决了问题.

我决定不提这个问题,以防其他人遇到这个问题.您以为自己会做某事,但是时间在前进.

I decided to leave this question up in case anyone else runs into this problem. You think you know how to do something, but time marches on.