问题现象
执行java -jar后显示没有主清单属性
问题分析
缺少了项目maven插件 spring-boot-maven-plugin。
解决方法
查看项目打包的pom.xml文件中,添加配置如下:
<!-- 打包格式 -->
<packaging>jar</packaging>
<!-- 打包插件 -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
<layout>JAR</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<attach>false</attach>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>