首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 服务器 > Apache >

maven 遇到有关问题

2013-11-13 
maven 遇到问题 求助suiteXmlFiles is configured, but there is no TestNG dependency我明明配置了 junit

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那块去掉。

热点排行