且构网

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

由于缺少EmbeddedServletContainerFactory bean,无法启动EmbeddedWebApplicationContext

更新时间:2021-09-22 16:52:05

好的,所以我在殴打我对此有所了解......我有以下内容:

Ok, So i was beating my head over this... I had the following:

/**
 * Main class.
 */
@SpringBootApplication
public class Application {

  /**
   * Main entry point for the application.
   *
   * @param args The args to pass in
   */
  public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
  }
}

我所有的依赖都是正确的..

and all my dependencies were correct..

经过详尽的搜索后,我发现了以下内容:

After an exhausive search, i found the following:

http://docs.spring.io/spring-boot/docs / current-SNAPSHOT / reference / htmlsingle /#getting-started-first-application-executable-jar

因为我没有弹簧启动父亲作为我的父,我必须在我的插件配置中包含执行部分,如下所示:

Since i dont have the spring boot parent as my parent, I had to include the executions section in my plugin configuration like so:

      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
          <mainClass>your.Application.fqdn.here</mainClass>
          <layout>ZIP</layout>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
          </execution>
        </executions>
      </plugin> 

有关其他信息,请参阅以下内容:

See the following for additional info:

http:// docs。 spring.io/spring-boot/docs/1.4.0.BUILD-SNAPSHOT/maven-plugin/usage.html