Reputation: 71
I got the below error while executing the command mvn clean test. Even though I changed the versions of the surefire plugin but still I'm facing the same error.
Error Log:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test (default-test) on pr
oject info: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\Sheik Mohammed\eclipse-workspace\info\target\surefire-reports for the individua
l test results.
**Error 1:**
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
**Error 2:**
[ERROR] ExecutionException The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
**Error 3:**
[ERROR] Command was cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_311\jre\bin\java" "-javaagent:C:\Users\Sheik
Mohammed\.m2\repository/org/aspectj/aspectjweaver/1.8.10/aspectjweaver-1.8.10.jar" " -Dcucumber.options=--plu
gin io.qameta.allure.cucumber4jvm.AllureCucumber4Jvm" --add-modules java.base ${argLine} -Xmx1024m -XX:MaxPerm
Size=256m org.apache.maven.surefire.booter.ForkedBooter "C:\Users\Sheik Mohammed\AppData\Local\Temp\surefire8647
270359642587079" 2022-02-27T09-33-26_575-jvmRun1 surefire8833373504517140594tmp surefire_08041519546226636871tmp
"
**Error 4:**
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR] **org.apache.maven.surefire.booter.SurefireBooterForkException: ExecutionException The forked VM terminate
d without properly saying goodbye. VM crash or System.exit called?**
[ERROR] Command was cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_311\jre\bin\java" "-javaagent:C:\Users\Sheik
Mohammed\.m2\repository/org/aspectj/aspectjweaver/1.8.10/aspectjweaver-1.8.10.jar" " -Dcucumber.options=--plu
gin io.qameta.allure.cucumber4jvm.AllureCucumber4Jvm" --add-modules java.base ${argLine} -Xmx1024m -XX:MaxPerm
Size=256m org.apache.maven.surefire.booter.ForkedBooter "C:\Users\Sheik Mohammed\AppData\Local\Temp\surefire8647
270359642587079" 2022-02-27T09-33-26_575-jvmRun1 surefire8833373504517140594tmp surefire_08041519546226636871tmp
"
[ERROR] Error occurred in starting fork, check output in log
pom.xml
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<aspectj.version>1.8.10</aspectj.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<forkedProcessExitTimeoutInSeconds>120</forkedProcessExitTimeoutInSeconds>
<forkCount>3</forkCount>
<reuseForks>true</reuseForks>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
-Dcucumber.options="--plugin io.qameta.allure.cucumber4jvm.AllureCucumber4Jvm"
--add-modules java.base ${argLine} -Xmx1024m -XX:MaxPermSize=256m
</argLine>
<systemPropertyVariables>
<allure.results.directory>${project.build.directory}/allure-results</allure.results.directory>
<allure.link.issue.pattern>https://example.org/browse/{}</allure.link.issue.pattern>
<allure.link.tms.pattern>https://example.org/browse/{}</allure.link.tms.pattern>
</systemPropertyVariables>
</configuration>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>4.2.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>tech.grasshopper</groupId>
<artifactId>extentreports-cucumber6-adapter</artifactId>
<version>2.6.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>pdfbox2-layout</artifactId>
<groupId>com.github.ralfstuckert.pdfbox-layout</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.25</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>4.8.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-testng -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-testng</artifactId>
<version>4.8.1</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>6.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-core</artifactId>
<version>1.2.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-cucumber4-jvm -->
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-cucumber4-jvm</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-maven -->
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-testng</artifactId>
<version>2.13.0</version>
</dependency>
<!-- <dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire</artifactId>
<version>3.0.0-M4</version>
<type>pom</type>
</dependency>-->
</dependencies>
Upvotes: 7
Views: 86955
Reputation: 1
Try this command:
mvn clean install -Dlogging.root=[filepath]\logs
mvn clean install -Dlogging.root=C:\git_repo\payment-service\logs
Note: it won't skip any test cases.
Upvotes: 0
Reputation: 1193
Solution 1: I encountered an error due to a failed unit test. To resolve this error, please review the failed unit test and ensure that it passes successfully, as fixing the test will bypass the error.
If you are experiencing an error in your Spring Boot application due to a failed unit test, the best approach is to identify and fix the issue causing the test failure.
Identify the failed unit test
Solution 2: If you are facing an error due to a failed unit test and you have this configuration in your pom.xml file to skip the test.
Add the plugin in your maven pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
I hope this helps! Let me know if you have any questions or if there's anything else I can assist you with.
Happy coding! 👨💻
Upvotes: 4
Reputation: 392
I had this error and it happened because of a failed unit test. So, you just need to check the failed unit test and make it pass to bypass this error.
Upvotes: 1
Reputation: 19
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
Upvotes: 1
Reputation: 1
The problem can be solve by changing the environnement excecution of MVN.
Try this command:
- apt install locales-all
- update-locale LANG=fr_FR.UTF-8 LANGUAGE
- update-locale LC_TIME=fr_FR.UTF-8
- update-locale LANG="fr_FR.UTF-8" LANGUAGE="fr_FR"
- dpkg-reconfigure locales
- apt-get update >/dev/null
- apt-get install -y locales >/dev/null
- echo "fr_FR UTF-8" > /etc/locale.gen
- locale-gen fr_FR.UTF-8
- export LANG=fr_FR.UTF-8
- export LANGUAGE=fr_FR:fr
- export LC_ALL=fr_FR.UTF-8
Upvotes: -1
Reputation: 224
You can try this: Add this code in the plugins section of your pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
You can see this link https://programmerah.com/solved-there-are-test-failures-please-refer-to-djava_studyspringbootspringboot-sugon-3targetsurefire-reports-for-the-individual-test-results-28892/
Upvotes: 18