论坛首页 入门技术论坛

[maven2] No Java test frameworks found

浏览 3069 次
该帖已经被评为新手帖
作者 正文
   发表时间:2007-03-01  
    还是一个与dependency相关的问题,对于允许junit测试来说,如果设置不当,则会出现 No Java test frameworks found
比如我的
dependency代码如下:
xml 代码
 
  1. <dependency>  
  2.     <groupId>lib<!---->groupId>  
  3.     <artifactId>junit<!---->artifactId>  
  4.     <version>4.1<!---->version>  
  5.     <scope>system<!---->scope>  
  6.     <systemPath>${basedir}/lib/junit-4.1.jar<!---->systemPath>  
  7. <!---->dependency>  
结果允许mvn test时候如下如下提示
java 代码
  1. [ERROR] BUILD ERROR  
  2. [INFO] ------------------------------------------------------------------------  
  3. [INFO] No Java test frameworks found  
  4. [INFO] ------------------------------------------------------------------------  
  而如果将<groupId>lib<!---->groupId> =》 <groupId>junit<!---->groupId>,则测试正常运行。

  由此可得出,运行junit所需groupId artifactId都是要设置正确

  详细参考maven.apache.org/plugins/maven-surefire-plugin/usage.html
   发表时间:2007-03-01  
C:\Documents and Settings\Administrator\.m2(默认情况)下有你整个maven下载下来的jar包的目录结构,junit的如下:C:\Documents and Settings\Administrator\.m2\repository\junit\junit\3.8.1,注意junit\junit\3.8.1,依次为:groupId,artifactId,version,照着这个设置就可以了!
0 请登录后投票
   发表时间:2007-03-01  
小疯子 写道
C:\Documents and Settings\Administrator\.m2(默认情况)下有你整个maven下载下来的jar包的目录结构,junit的如下:C:\Documents and Settings\Administrator\.m2\repository\junit\junit\3.8.1,注意junit\junit\3.8.1,依次为:groupId,artifactId,version,照着这个设置就可以了!


对于center repository来说,绝对正确
0 请登录后投票
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics