maven-failsafe-plugin Errors and BUILD SUCCESS?

You need having two executions blocks, cause the verify goal of the maven-failsafe-plugin is intended to check the results of the integration tests. <executions> <execution> <id>functional-test-1024</id> <phase>test</phase> <goals> <goal>integration-test</goal> </goals> <configuration> <includes> <include>**/IntegrationTierFunctionalTestCase.java</include> </includes> <forkMode>once</forkMode> <argLine>-XX:MaxPermSize=256M -Xmx1024M</argLine> </configuration> </execution> <execution> <id>verify</id> <phase>verify</phase> <goals> <goal>verify</goal> </goals> </execution> </executions> Furthermore you should update the version of the … Read more

Maven separate Unit Test and Integration Tests

The solution is this: <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19.1</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>2.19.1</version> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.6.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip>${surefire.skip}</skip> </configuration> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> … Read more

Merging Integration and Unit test reports with JaCoCo

I recently implemented this: after some headaches and a lot of testing, I have a configuration that works beautifully. <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>${jacoco.version}</version> <executions> <execution> <id>pre-unit-test</id> <goals> <goal>prepare-agent</goal> </goals> <configuration> <destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile> <propertyName>surefireArgLine</propertyName> </configuration> </execution> <execution> <id>pre-integration-test</id> <goals> <goal>prepare-agent-integration</goal> </goals> <configuration> <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile> <propertyName>testArgLine</propertyName> </configuration> </execution> <execution> <id>post-integration-test</id> <phase>post-integration-test</phase> <goals> <goal>report</goal> </goals> <configuration> <dataFile>${project.build.directory}/coverage-reports/jacoco-it.exec</dataFile> <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> </configuration> </execution> … Read more

Maven fail-safe not executing tests

Your tests are not in the default test sources directory src/test/java. See: https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html myModule/src/main/test/java/ClientAccessIT.java should be: myModule/src/test/java/ClientAccessIT.java You could also update your pom file (if you really wanted tests to live in main) to include: <build> <testSources> <testSource> <directory>src/main/test</directory> </testSource> </testSources> </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

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

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

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