maven TestNg 测试框架 not found

来源:互联网 发布:sql带参数的存储过程 编辑:程序博客网 时间:2024/06/05 03:05

在用TestNG测试框架进行单元测试时,在我的pom.xml中写的依赖:

     <dependency>            <groupId>org.testng</groupId>            <artifactId>testng</artifactId>            <version>6.9.4</version>            <scope>test</scope>     </dependency>
Maven说他在中央仓库没有没有找到,我在下面这两个maven仓库的网站查找我的TestNG也没有找到:

http://mvnrepository.com/

http://maven.oschina.net/home.html

折腾了半天,查了好些资料,然后去了TestNG的官网(http://testng.org/doc/download.html),

哎,找到问题的答案了!!


其实只要在我的pom.xml中指定TestNG的仓库,Maven小伙就知道去哪里找TestNG了:

    <repositories>        <repository>            <id>central</id>            <name>bintray</name>            <url>http://jcenter.bintray.com</url>        </repository>    </repositories>
从这个故事中I see,当下次再遇到类似问题时,不应该是在浩瀚的网页中瞎找答案,直接去其官网,也许就会有你意想不到的发现。呵呵!!


0 0
原创粉丝点击