maven-surefire-plugin

Surefire doesn't launch test in src/main/java

假装没事ソ 提交于 2019-11-29 01:12:07
I needed to move some src/test/java to src/main/java according to this recommandation from maven-jar-plugin documentation => http://maven.apache.org/plugins/maven-jar-plugin/usage.html I did so because, i used tests (helper) classes in another projects in test scope. So i create my-project-test, moved in test classes, and configured surefire to specify test classes directory => <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <testSourceDirectory>${basedir}\src\main\java\</testSourceDirectory> </configuration>

How to run individual test in the integration-test target in maven

时光总嘲笑我的痴心妄想 提交于 2019-11-28 17:23:41
问题 We have a hundreds of tests defined for our integration-test phase lifecycle in maven, and they take a long time to finish. What I want to do is run just one test in the integration-test . I tried doing : mvn -Dtest=<my-test> integration-test but that does not work. The -Dtest runs only the tests in the unit test goal, not the integration-test phase. I tried the -Dintegration-test=<my-test> instead, and that was ignored. Is there a way to do that ? My configuration is: <plugin> <groupId>org

Maven build and maven-failsafe-plugin - The forked VM terminated without properly saying goodbye

不羁的心 提交于 2019-11-28 07:22:26
问题 I use Docker and https://github.com/fabric8io/docker-maven-plugin for my integration tests. On my Windows 10 ( after updating to Windows 10 1709 ) machine I faced the following error with my Maven 3.5.0 build: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.20.1:verify (default) on project api: There are test failures. [ERROR] [ERROR] Please refer to D:\Projects\example\api\target\failsafe-reports for the individual test results. [ERROR] Please refer to dump

How to exclude all JUnit4 tests with a given category using Maven surefire?

亡梦爱人 提交于 2019-11-28 06:56:01
I intend on annotating some of my JUnit4 tests with an @Category annotation. I would then like to exclude that category of tests from running on my Maven builds. I see from the Maven documentation that it is possible to specify a category of tests to run. I want to know how to specify a category of tests not to run. Thanks! You can do this as follows: Your pom.xml should contain the following setup. <configuration> <excludes> <exclude>**/TestCircle.java</exclude> <exclude>**/TestSquare.java</exclude> </excludes> </configuration> If you want regex support just use <excludes> <exclude>%regex[.*

How do I make Jenkins build fail when Maven unit tests fail?

放肆的年华 提交于 2019-11-28 06:42:16
I'm using Jenkins, Maven 3.1, and Java 1.6. I have the following Maven job set up in Jenkins with the following goals and options ... clean install -U -P cloudbees -P qa below is my pom.xml surefire configuration ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.17</version> <configuration> <reuseForks>true</reuseForks> <argLine>-Xmx2048m -XX:MaxPermSize=512M </argLine> <skipTests>false</skipTests> </configuration> </plugin> However, when my unit tests fail, the Jenkins console output still says "BUILD SUCCESS" and the build is

Strategy for debugging surefire “The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?”

夙愿已清 提交于 2019-11-28 05:51:47
I am working on a rather complex java project with many dependencies and many unit tests. I am using java 1.6.0_65 on mac (mavericks) with maven 3.0.5 with maven-surefire-plugin:2.16 running in several forks. My problem is that running this setup with several forks causes a fork to exit with: "The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?" running this with only one fork does not produce the problem (and everything passes) There is some information out there about this problem including this StackOverflow question and this surefire bug (which seems

Spring Boot fails to run maven-surefire-plugin ClassNotFoundException org.apache.maven.surefire.booter.ForkedBooter

和自甴很熟 提交于 2019-11-28 04:37:51
Running maven (3.5.2) build of a Spring Boot 2.0.2.RELEASE applicaton (generated by web initialiser with web dependencies) fails executing the maven-surefire-plugin saying just: Error: Could not find or load main class org.apache.maven.surefire.booter.ForkedBooter Caused by: java.lang. ClassNotFoundException : org.apache.maven.surefire.booter. ForkedBooter Why is this happening? Is it a problem in boot + surefire integration = a bug? For reference, the dependencies that seem relevant are: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId>

Troubles with SureFire plugin: -“The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? ” [duplicate]

半腔热情 提交于 2019-11-27 23:26:49
问题 This question already has answers here : Strategy for debugging surefire “The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?” (10 answers) Closed 4 years ago . While running of unit tests following exception occurs: org.apache.maven.lifecycle.LifecycleExecutionException: ExecutionException; nested exception is java.util.concurrent.ExecutionException: java.lang.RuntimeException: The forked VM terminated without saying properly goodbye. VM crash or System

How can I get maven-release-plugin to skip my tests?

时光毁灭记忆、已成空白 提交于 2019-11-27 16:43:13
How can I get the maven-release-plugin to run without triggering the tests? I have tried -Dmaven.test.skip=true and -DskipTests and -DpreparationGoals=clean ...yet none work. Yes, I know I shouldn't release if the tests don't pass, but I don't have control over making my coworkers write reliable tests. bmargulies -Darguments="-DskipTests" is what you want, or explicitly configuring the forked executions in the pom. Engineer Dollery -Darguments="..." passes arguments to the forked maven process, but it is important to realise that there are two different switches being used here. The

Generate test-jar along with jar file in test package

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 13:59:02
I want to package my test package to jar file . How to execute generate test-jar from maven plugin Surefire. Dharshana You can add following entries to your pom: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.4</version> <executions> <execution> <goals> <goal>test-jar</goal> </goals> </execution> </executions> </plugin> By using the following configuration you can create a jar from your tests: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.6</version> <executions> <execution>