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

test执行不了

D:\maven\code\maven01>mvn test

[INFO] Scanning for projects...

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building maven01-model 0.0.1-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ maven01-mo

del ---

[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e

. build is platform dependent!

[INFO] skip non existing resourceDirectory D:\maven\code\maven01\src\main\resour

ces

[INFO]

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ maven01-model -

--

[INFO] Changes detected - recompiling the module!

[WARNING] File encoding has not been set, using platform encoding GBK, i.e. buil

d is platform dependent!

[INFO] Compiling 1 source file to D:\maven\code\maven01\target\classes

[INFO] -------------------------------------------------------------

[ERROR] COMPILATION ERROR :

[INFO] -------------------------------------------------------------

[ERROR] /D:/maven/code/maven01/src/main/java/com/imooc/maven01/model/HelloWorld.

java:[2,1] 需要class, interface或enum

[ERROR] /D:/maven/code/maven01/src/main/java/com/imooc/maven01/model/HelloWorld.

java:[4,14] 需要';'

[ERROR] /D:/maven/code/maven01/src/main/java/com/imooc/maven01/model/HelloWorld.

java:[4,15] 方法声明无效; 需要返回类型

[INFO] 3 errors

[INFO] -------------------------------------------------------------

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 1.722 s

[INFO] Finished at: 2018-05-26T17:43:24+08:00

[INFO] Final Memory: 9M/150M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.

1:compile (default-compile) on project maven01-model: Compilation failure: Compi

lation failure:

[ERROR] /D:/maven/code/maven01/src/main/java/com/imooc/maven01/model/HelloWorld.

java:[2,1] 需要class, interface或enum

[ERROR] /D:/maven/code/maven01/src/main/java/com/imooc/maven01/model/HelloWorld.

java:[4,14] 需要';'

[ERROR] /D:/maven/code/maven01/src/main/java/com/imooc/maven01/model/HelloWorld.

java:[4,15] 方法声明无效; 需要返回类型

[ERROR] -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit

ch.

[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 rea

d the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc

eption

代码没有发现问题,和老师 的一样

正在回答

2 回答

是不是测试的包名错了

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

在测试类上再import一下 HelloWorld就好了

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

慕婉清6845081

还是不行呀
2018-06-10 回复 有任何疑惑可以回复我~

举报

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

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

进入课程

test执行不了

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