Linux执行Jar包报错: no main manifest attribute
在服务器上面使用java -jar执行jar包的时候,报如下错误
需要在pom.xml中加入以下配置
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<includeSystemScope>true</includeSystemScope>
<mainClass>com.cs.xxxxApplication</mainClass>
</configuration>
</plugin>
然后重新打包,再执行,就没啥问题了