Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date]... 的解决办法
问题概述
关于这个问题,
是接手一个老老老项目的时候遇见的,
在install打包编译的时候,
遇到:“ Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. ”
如下图:
错误信息如下:
There are test failures.
Please refer to E:\MY_CODE\...\target\surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
解决办法
关于这个问题的根本原因还是项目的测试方法代码写的有BUG,导致了打包编译不通过,
需要分析错误信息,找到代码BUG,解决即可!
这里说,两种解决办法,临时解决办法、永久解决办法,
一、临时解决办法
如果是先让项目跑起来,则可以先跳过测试方法的代码BUG,
在pom.xml的
<!--编译跳过测试文件检查的生命周期-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
如下图:
完成的build节点组件内容如下(按需配置该节点):
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<!--将项目相关配置文件放在源码java包下,也需要编译-->
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.py</include>
<include>**/*.properties</include>
<include>**/*.yml</include>
<include>**/*.yaml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!--编译跳过测试文件检查的生命周期-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<!--使用docker-maven-plugin插件-->
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<dockerHost>http://192.168.56.10:2375</dockerHost>
<imageName>bayou-mall/${project.artifactId}</imageName>
<imageTags>
<imageTag>${project.version}</imageTag>
</imageTags>
<forceTags>true</forceTags>
<dockerDirectory>${project.basedir}</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
重新启动项目,
更新项目的Maven依赖包,
clean
install,就可以成功的,打包编译通过了,如下图:
二、永久解决办法
永久解决办法,那就是找到这个BUG,
每个人的BUG都是不一样的,这里给两个解决思路,
1、首先还是版本的兼容,因为代码没有报错,依赖包之间的兼容,导致了项目启动“ 运行时 ”调用API时BUG,
2、API调用未知,依赖注入,地址错误,
3、最后才考虑自己的代码些错了,通过静态代码走查,
好了,关于 Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date]… 的解决办法 就写到这儿了,如果还有什么疑问或遇到什么问题欢迎扫码提问,也可以给我留言哦,我会一一详细的解答的。
歇后语:“ 共同学习,共同进步 ”,也希望大家多多关注CSND的IT社区。
作 者: | 华 仔 |
联系作者: | who.seek.me@java98k.vip |
来 源: | CSDN (Chinese Software Developer Network) |
原 文: | https://blog.csdn.net/Hello_World_QWP/article/details/135529798 |
版权声明: | 本文为博主原创文章,请在转载时务必注明博文出处! |
还没有评论,来说两句吧...