java - Maven does not run integration tests using failsafe-plugin -
i know question asked more once. cannot make maven run integration tests using failsafe-plugin.
when execute mvn failsafe:integration-test failsafe:verify
runs integration tests. when execute mvn verify
integration tests not running.
pom.xml
<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.bahadirakin</groupid> <artifactid>integration-tests</artifactid> <version>1.0-snapshot</version> <packaging>jar</packaging> <name>integration-tests</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-failsafe-plugin</artifactid> <version>2.18.1</version> <configuration> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> </execution> </executions> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>4.12</version> <scope>test</scope> </dependency> </dependencies> </project>
an integration test
package com.bahadirakin.integration; import org.junit.assert; import org.junit.test; public class serviceit { @test public void testfail() throws exception { assert.fail(); } }
as can see expect fail.
maven version
apache maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11t23:58:10+03:00) maven home: /usr/local/cellar/maven/3.2.3/libexec java version: 1.7.0_25, vendor: oracle corporation java home:/library/java/javavirtualmachines/jdk1.7.0_25.jdk/contents/home/jre default locale: en_us, platform encoding: utf-8 os name: "mac os x", version: "10.10.3", arch: "x86_64", family: "mac"
update mvn clean verify -x
output link.
please change build section way (without configuration tag):
<build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-failsafe-plugin</artifactid> <version>2.18.1</version> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
Comments
Post a Comment