no main manifest attribute(linux打包时)
场景
springboot项目,子模块继承父模块,在子模块配置:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
然后进行打包,java -jar 运行后便出现这个错误,解压jar包后,在META-INF/MANIFEST.MF中没有主类配置(其实少了很多配置)
原因
虽然引入了spring-boot-maven-plugin,但是却没有引入springboot的父级,
解决
在父工程中引入springboot父级包即可,继承该父工程的子模块便能正常打包
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
</parent>