为了账号安全,请及时绑定邮箱和手机立即绑定

mvn test报错

C:\Users\Du-Trenton\Desktop\code\maven01>mvn test
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.imooc.maven01:maven01-model:jar:0.0.1SNAPSHOT
[WARNING] 'version' uses an unsupported snapshot version format, should be '*-SNAPSHOT' instead. @ line 7, column 14
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maven01-model 0.0.1SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ maven01-model ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Du-Trenton\Desktop\code\maven01\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ maven01-model ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ maven01-model ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Du-Trenton\Desktop\code\maven01\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ maven01-model ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\Du-Trenton\Desktop\code\maven01\target\test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/Du-Trenton/Desktop/code/maven01/src/test/java/com/imooc/maven01/model/HelloWorldTest.java:[9,56] 找不到符号
  符号:   类 HelloWorld
  位置: 类 com.imooc.maven01.model.HelloWorldTest
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.491 s
[INFO] Finished at: 2016-10-09T18:53:35+08:00
[INFO] Final Memory: 13M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project maven01-model: Compilation failure
[ERROR] /C:/Users/Du-Trenton/Desktop/code/maven01/src/test/java/com/imooc/maven01/model/HelloWorldTest.java:[9,56] 找不到符号
[ERROR] 符号:   类 HelloWorld
[ERROR] 位置: 类 com.imooc.maven01.model.HelloWorldTest
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

正在回答

5 回答

HelloWorldTest.java:[9,56] 找不到符号

应该是 HelloWorldTest.java 文件第9行附近出现问题。

0 回复 有任何疑惑可以回复我~

我的问题也一样,主要是我

HelloWorld.java 程序里面没有放下面这个PACKAGE,后面补上就通过了

package com.imooc.maven01.model;


0 回复 有任何疑惑可以回复我~

解决了吗,我的也是,行数都是一样的。

0 回复 有任何疑惑可以回复我~

解决了吗?方便告知下怎么解决的吗?

0 回复 有任何疑惑可以回复我~

朋友你解决了吗、如果解决了麻烦能不能告诉我怎么弄、我的情况和你一摸一样

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
项目管理利器——maven
  • 参与学习       173090    人
  • 解答问题       742    个

使用maven来构建和管理Java项目,从环境配置,到maven核心知识

进入课程

mvn test报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信