You are viewing a plain text version of this content. The canonical link for it is here.
Posted to surefire-users@maven.apache.org by Nalaka Gamage <na...@gmail.com> on 2008/10/31 11:43:19 UTC

Running both Junit4 and TestNG test cases in single Maven project

In my project I need to have both both Junit4 and TestNG test cases and
build using Maven2.

However I found that when I run 'mvn test' goll, Junit4 test cases are
ignored by Maven surfire plugin and only TestNG test cases are run. However
when I use JUnit3 and TestNG test cases together, both the test cases are
picked correctly. Can anyone propose a solution?

I have append my POM file for your reference.

Thanks in advance.

- Nalaka
<project>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.3.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>5.8</version>
            <scope>test</scope>
            <classifier>jdk15</classifier>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>