1 自己打包Spring boot项目依赖了第三方的Phoenix jar包过大,导致启动后报错
参考了这篇博客:https://cloud.tencent.com/developer/ask/135010
发现是不支持文件数过多,然后根据文章:
说到需要改变文件创建方式,自己再点击进去去查询问题:
https://github.com/spring-projects/spring-boot/issues/2895
在这个问题列表后面,大家讨论了,大概有人提交了修复bug,然后,自己去看,发现支持的版本要到Spring boot 2.2.x的版本,现在发布版本最新的才2.0.3,我绝望了,直到最后发现。
As a workaround, I switched to use maven shade plugin. It worked!
改变Maven的打包插件采用shade插件,查了下这个插件貌似就是把大的jar包拆分
自己的maven shade插件配置,就只保留了这一个打包,自己的参数Main方法,根据自己的项目去调整
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.1.6.RELEASE</version> </dependency> </dependencies> <!--<configuration>--> <!--<includeSystemScope>true</includeSystemScope>--> <!--</configuration>--> <!--<configuration>--> <!--<includeSystemScope>true</includeSystemScope>--> <!--</configuration>--> <configuration> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope> <createDependencyReducedPom>true</createDependencyReducedPom> <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.DSA</exclude> <exclude>META-INF/*.RSA</exclude> </excludes> </filter> </filters> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/spring.handlers</resource> </transformer> <transformer implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer"> <resource>META-INF/spring.factories</resource> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/spring.schemas</resource> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <manifestEntries> <Main-Class>com.wm.bigdata.WmBigdataBiApplication</Main-Class> </manifestEntries> </transformer> </transformers> </configuration> </execution> </executions> </plugin>
最后解决了问题,感谢,最后回复的哪位小哥,解决了我的问题