命令行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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM