Maven打包错误:Execution default of goal org.springframew ork.boot:spring-boot-maven-plugin:2.1.8.RELEASE

打包fail失败错误信息

在这里插入图片描述

错误原因

原因在于maven引入了这个,它会在打包时会去扫描项目main方法入口,如果没有就会如上报错

      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
          <executable>true</executable>
        </configuration>
      </plugin>

解决方式

1.创建springboot启动类
2.更改pom.xml配置为

      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
          <executable>true</executable>
        </configuration>
        <executions>
          <execution>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>

猜你喜欢

转载自blog.csdn.net/qq_38425803/article/details/106793788