java Springboot项目在本地运行正常,打成jar包放上服务器后,用命令启动后报错: no main manifest attribute in… XX.jar,以上错误需要在原工程pom文件中加入如下配置,重新打包上传,启动成功
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<includeSystemScope>true</includeSystemScope>
<mainClass>com.zsm.alibaba.ServiceRegistryApplication</mainClass>
</configuration>
</plugin>
</plugins>
</build>