IntelliJ Error when running unit test: Could not find or load main class ${surefireArgLine}

I had the same problem and i think i found the solution on the vertx-issue tracker. In short you have to configure your IntelliJ Maven (surefire plugin) integration to behave differently. This works for me in IntelliJ 14.1.6 with mvn 3.3.9 Preferences -> Build,Execution,Deployment -> Build Tools -> Maven -> Running Tests For IntelliJ 2019 … Read more

Make maven’s surefire show stacktrace in console

A related problem that I found is that surefire in recent versions apparently sets trimStackTrace to true by default (rendering most stack trace in failed tests useless), which is quite inconvenient. Setting -DtrimStackTrace=false or defining <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <trimStackTrace>false</trimStackTrace> </configuration> </plugin> solved this.

What is the difference between the Maven Surefire and Maven Failsafe plugins?

In simple words, the Failsafe plugin is designed to run integration tests while Surefire to run unit tests. This is further explained in Maven FAQ: maven-surefire-plugin is designed for running unit tests and if any of the tests fail then it will fail the build immediately. maven-failsafe-plugin is designed for running integration tests, and decouples … Read more

Surefire is not picking up Junit 5 tests

The maven-surefire-plugin, as of today, does not have full support of JUnit 5. There is an open issue about adding this support in SUREFIRE-1206. As such, you need to use a custom provider. One has already been developed by the JUnit team; from the user guide, you need to add the junit-platform-surefire-provider provider and the … Read more

Prevent unit tests but allow integration tests in Maven

I found the simplest way to skip only surefire tests is to configure surefire (but not failsafe) as follows: <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.14</version> <configuration> <!– skips surefire tests without skipping failsafe tests. Property value seems to magically default to false –> <skipTests>${skip.surefire.tests}</skipTests> </configuration> </plugin> This allows you to run mvn verify -Dskip.surefire.tests and only surefire, not … Read more

Making Maven run all tests, even when some fail

From the Maven Embedder documentation: -fae,–fail-at-end Only fail the build afterwards; allow all non-impacted builds to continue -fn,–fail-never NEVER fail the build, regardless of project result So if you are testing one module than you are safe using -fae. Otherwise, if you have multiple modules, and if you want all of them tested (even the … Read more

The forked VM terminated without saying properly goodbye. VM crash or System.exit called

I had the same problem and solved by adding: <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine> The whole plugin element is: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <forkCount>3</forkCount> <reuseForks>true</reuseForks> <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine> </configuration> </plugin>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)