首先我去翻译了一下 有道词典还是蛮好用的
- 在register.jar中没有主manifest属性
在部署之前我在本地运行没有任何问题
这是说的什么意思呢?是讲你这个jar包没有找到主类,打包有问题
解决方式:
在pom.xml中添加这么一段,就欧克了
<plugin>
<!-- The plugin rewrites your manifest -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.2.6.RELEASE</version>
<configuration>
<!-- 指定该Main Class为全局的唯一入口 -->
<!-- 这个地址是你自己启动类的地址-->
<mainClass>com.alibaba.RegisterApplication</mainClass>
<layout>ZIP</layout>
<fork>true</fork>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
</goals>
<!--可以生成不含依赖包的不可执行Jar包-->
<!--<configuration>-->
<!--<classifier>exec</classifier>-->
<!--</configuration>-->
</execution>
</executions>
</plugin>
ps:简书找到的解决方式
<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>xxx.xxx.xxx.xxx</mainClass>
</configuration>
</plugin>