Howto add another test source folder to Maven and compile it to a separate folder?

Based what you’ve written it sounds like you didn’t named your integration tests correctly and you didn’t use the maven-failsafe-plugin for your integration tests. Based on the convention of the maven-failsafe-plugin you should name your integration tests like *IT.java. If you named your integration tests appropriately you can handle that with a more or less … Read more

How to execute JUnit and TestNG tests in same project using maven-surefire-plugin?

Official way with selecting providers. You can also specify multiple providers as dependencies, and they will all be run and produce a common report. This may be especially handy with external providers, since there are few use-cases for combining the included providers. <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.18.1</version> <dependencies> <dependency> <groupId>org.apache.maven.surefire</groupId> <artifactId>surefire-junit47</artifactId> <version>2.18.1</version> </dependency> <dependency> <groupId>org.apache.maven.surefire</groupId> <artifactId>surefire-testng</artifactId> <version>2.18.1</version> … Read more

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

Workaround for the issue was to override Spring Boot’s maven-surefire-plugin definition and set useSystemClassLoader to false. Read Surefire docs for more details <build> <plugins> … <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <useSystemClassLoader>false</useSystemClassLoader> </configuration> </plugin> </plugins> </build>

How can I skip tests in maven install goal, while running them in maven test goal?

It sounds like you didn’t understand the concept of the build life-cycle in Maven. If you run mvn install all life-cycle phases (including the install phase itself) run before the install phase. This means running the following phases: validate initialize generate-sources process-sources generate-resources process-resources compile process-classes generate-test-sources process-test-sources generate-test-resources process-test-resources test-compile process-test-classes test prepare-package package … Read more

Cannot use jacoco JVM args and surefire JVM args together in maven

Try using @{argLine} instead of ${argLine} (or surefire.argLine in your case) It allows surefire to read a property as modified by other plugins instead of reading the one substituted by Maven itself. Then you can set the argLine param to empty in Maven properties: <properties> <argLine></argLine> </properties> Which now will not cause any problems. More … Read more

How to run JUnit tests by category in Maven?

Maven has since been updated and can use categories. An example from the Surefire documentation: <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.11</version> <configuration> <groups>com.mycompany.SlowTests</groups> </configuration> </plugin> This will run any class with the annotation @Category(com.mycompany.SlowTests.class)

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