日期:2014-05-16  浏览次数:21074 次

maven 遇到问题 求助
suiteXmlFiles is configured, but there is no TestNG dependency   

我明明配置了 junit 的依赖 为嘛 他一直 找 TestNG 的配置  用的以下插件 

<!-- test插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<includes>
<include>**/Test*.java</include>
</includes>
</configuration>
</plugin>

------解决方案--------------------
<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>${surefire.version}</version>
    <dependencies>
        <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-junit47</artifactId>
            <version>${surefire.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-testng</artifactId>
            <version>${surefire.version}</version>
        </dependency>
    </dependencies>
</plugin>

这个是同时用junit和testng, 如果你只想用junit,就把testng那块去掉。