启动SpringBoot的可执行jar 报错:target\spring-boot-hello-1.0-SNAPSHOT.jar中没有主清单属性

  打包成功,但是在执行时报错,没有主清单属性

  

解决:

  增加红框内的依赖:

  

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

猜你喜欢

转载自www.cnblogs.com/lfalex0831/p/8967428.html