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

mvn test执行报错

Microsoft Windows [版本 6.1.7601]

版权所有 (c) 2009 Microsoft Corporation。保留所有权利。


C:\Users\Administrator>mvn -v

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:4

7+08:00)

Maven home: C:\apache-maven-3.3.9

Java version: 1.8.0_60, vendor: Oracle Corporation

Java home: C:\Java\jdk1.8.0_60\jre

Default locale: zh_CN, platform encoding: GBK

OS name: "windows 7", version: "6.1", arch: "x86", family: "dos"


C:\Users\Administrator>F:


F:\>cd F:\MavenTest\code\maven01


F:\MavenTest\code\maven01>mvn compile

[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 '*-SN

APSHOT' instead. @ line 11, column 11

[WARNING]

[WARNING] It is highly recommended to fix these problems because they threaten t

he stability of your build.

[WARNING]

[WARNING] For this reason, future Maven versions might no longer support buildin

g 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-mo

del ---

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

. build is platform dependent!

[INFO] skip non existing resourceDirectory F:\MavenTest\code\maven01\src\main\re

sources

[INFO]

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

--

[INFO] Nothing to compile - all classes are up to date

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

[INFO] BUILD SUCCESS

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

[INFO] Total time: 0.658 s

[INFO] Finished at: 2016-10-10T08:27:15+08:00

[INFO] Final Memory: 7M/16M

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


F:\MavenTest\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 '*-SN

APSHOT' instead. @ line 11, column 11

[WARNING]

[WARNING] It is highly recommended to fix these problems because they threaten t

he stability of your build.

[WARNING]

[WARNING] For this reason, future Maven versions might no longer support buildin

g such malformed projects.

[WARNING]

[INFO]

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

[INFO] Building maven01-model 0.0.1SNAPSHOT

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

[WARNING] The POM for org.apache.maven.plugins:maven-surefire-plugin:jar:2.12.4

is invalid, transitive dependencies (if any) will not be available, enable debug

 logging for more details

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

[INFO] BUILD FAILURE

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

[INFO] Total time: 0.184 s

[INFO] Finished at: 2016-10-10T08:27:26+08:00

[INFO] Final Memory: 5M/15M

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

[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or one of i

ts dependencies could not be resolved: Failed to read artifact descriptor for or

g.apache.maven.plugins:maven-surefire-plugin:jar:2.12.4: 1 problem was encounter

ed while building the effective model

[ERROR] [FATAL] Non-parseable POM C:\Users\Administrator\.m2\repository\org\apac

he\maven\plugins\maven-surefire-plugin\2.12.4\maven-surefire-plugin-2.12.4.pom:

in comment after two dashes (--) next character must be > not e (position: START

_TAG seen ...gin",uname+"|"+pass);\r\n} else {\r\n\tdelCookie("tj_login");\r\n}\

r\n//--e... @184:6)  @ line 184, column 6

[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/PluginResoluti

onException


F:\MavenTest\code\maven01>


正在回答

2 回答

你把0.0.1SNAPSHOT 改成0.0.1-SNAPSHOT,试试,看看还报这个问题吗?

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

一个哇塞的小伙 提问者

非常感谢!
2016-10-19 回复 有任何疑惑可以回复我~

是不是,你第一次安装maven而且没有联网。

试试在联网的情况下,运行 mvn  compile。

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

一个哇塞的小伙 提问者

问题已经解决 谢谢 并不是你说的原因 我一直连着网在看慕课网视频 照着做的。而且我也不可能运行一次失败了就跑来问
2016-10-19 回复 有任何疑惑可以回复我~

举报

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

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

进入课程

mvn test执行报错

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