命令行java -jar运行SpringBoot程序的jar包 报错:target\springboot-01-1.0-SNAPSHOT.jar中没有主清单属性

这是父工程(最下面的pom.xml)没有添加导入相关的依赖的缘故,需要添加以下依赖:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

具体要看官方文档:https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started.html#getting-started-first-application-executable-jar

posted @ 2020-08-25 18:47  Juff  阅读(1153)  评论(0)    收藏  举报