文档章节

maven build时报错Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test

MonroeCode
 MonroeCode
发布于 2017/05/06 12:33
字数 826
阅读 361
收藏 0

maven build时报错Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test

复制代码

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.319 s
[INFO] Finished at: 2017-02-24T10:05:13+08:00
[INFO] Final Memory: 16M/205M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project base-util: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or one of its dependencies could not be resolved: Failure to find org.apache.maven.surefire:maven-surefire-common:jar:2.12.4 in http://192.168.16.91/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of user-releases has elapsed or updates are forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project zhiyuan-base-util: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or one of its dependencies could not be resolved: Failure to find org.apache.maven.surefire:maven-surefire-common:jar:2.12.4 in http://192.168.16.91/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of user-releases has elapsed or updates are forced
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or one of its dependencies could not be resolved: Failure to find org.apache.maven.surefire:maven-surefire-common:jar:2.12.4 in http://192.168.16.91/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of user-releases has elapsed or updates are forced
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:104)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or one of its dependencies could not be resolved: Failure to find org.apache.maven.surefire:maven-surefire-common:jar:2.12.4 in http://192.168.16.91/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of user-releases has elapsed or updates are forced
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:208)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.createPluginRealm(DefaultMavenPluginManager.java:359)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupPluginRealm(DefaultMavenPluginManager.java:327)
    at org.apache.maven.plugin.DefaultBuildPluginManager.getPluginRealm(DefaultBuildPluginManager.java:230)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:100)
    ... 20 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find org.apache.maven.surefire:maven-surefire-common:jar:2.12.4 in http://192.168.16.91:8080/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of user-releases has elapsed or updates are forced
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:459)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367)
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:200)
    ... 24 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find org.apache.maven.surefire:maven-surefire-common:jar:2.12.4 in http://192.168.16.91/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of user-releases has elapsed or updates are forced
    at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:232)
    at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:599)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:518)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:436)
    ... 27 more
[ERROR] 
[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/PluginResolutionException

复制代码

可能原因有很多个, 
1. maven私服连不上了, 有一些jar包没有下载到本地, 或者是私服的路径配置错误

复制代码

<distributionManagement>
        <repository>
            <id>user-releases</id>
            <name>Nexus Release Repository</name>
            <url>http://192.168.16.91/nexus/content/repositories/releases/</url>
        </repository>
        <snapshotRepository>
            <id>user-snapshots</id>
            <name>Nexus Snapshot Repository</name>
            <url>http://192.168.16.91/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

复制代码

配置可以参考上面这段, url链接要在地址栏里面能打开才算正确

还有可能是一个jar包下载失败, jar包坏了, 可以删掉本地的repository, 执行maven->update project...重新下载jar到本地仓库


2. .classpath配置文件错误

  在项目上右键->properties->java build path->source->删掉里面的src/main/java和src/test/java配置, 然后点右侧的add folder重新添加

 

3. 测试类里面报错, 导致无法build

  可以删掉测试类, 重新尝试构建

 

4. 如果以上三个都无法解决这个问题, 那就删工作空间吧, 干掉workspace!!

© 著作权归作者所有

MonroeCode

MonroeCode

粉丝 89
博文 135
码字总数 225843
作品 0
深圳
运营/编辑
私信 提问
maven install 时报错

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project taotao-common: Execution default-test of goal org.apache.mave......

Zeromiki
2018/09/12
134
4
Maven运行mvn test报错

各位大神: 刚刚学习Maven使用eclipse创建一个普通Maven项目,使用maven-archetype-quickstart插件创建的。运行mvn test报错,头疼,请各位指点,以下是报错信息: [INFO] -----------------...

guangyongluo
2017/10/12
110
1
spiderman2执行.bat成功,使用eclipse却出现下面报错

@自风 想请教一下,这是什么情况? Results : Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO......

dear刺猬阿莫
2016/04/27
831
2
使用myeclipse自带的maven创建新项目,直接执行maven install报错

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.4.3:test (default-test) on project TestWidget: Execution default-test of goal org.apache.maven.plugins:ma......

DavidBao
2015/04/14
424
0
maven启动时为什么不忽略测试就会包以下报错(含解决方法)

错误信息: [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:t......

Liem_
2015/05/20
1K
1

没有更多内容

加载失败,请刷新页面

加载更多

用Javascript评估用户输入密码的强度

密码已经是我们生活工作中必不可少的工具,但一个不安全的密码有又有可能会给我们造成不必要的损失。作为网站设计者,如果我们在网页中能对用户输入的密码进行安全评估,并显示出相应的提示信息...

花漾年华
25分钟前
0
0
Python 打开目录与指定文件

Python打开外部文件有很多方法, os.popen打开外部程序,但发现只能打开文件所在目录的文件 os.system可打开外部文件os.system(command) command 要执行的命令,相当于在Windows...

shzwork
27分钟前
2
0
Leetcode # 118:Pascal's Triangle 杨辉三角

118:Pascal's Triangle 杨辉三角 Given a non-negative integer numRows, generate the first numRows of Pascal's triangle. 给定一个非负整数 *numRows,*生成杨辉三角的前 numRows 行。 ......

iCodeBugs
37分钟前
1
0
IntelliJ IDEA导入Gradle项目

1.File > Open 找到项目后选择build.gradle文件,点击ok image 2.点击Open as Project image 3.选择本地Gradle以及JDK image 4.点OK完成...

青峰Jun19er
41分钟前
1
0
Python实现斐波那契数列

斐波那契数列大家都很熟悉吧,咱们在高中学数学的时候,老师会讲这个定律以及算法,其实数据结构和数学息息相关,数学思维好的往往逻辑思维就比较好,今天小猿圈带大家学习一下python的斐波那...

小猿圈加加
42分钟前
3
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部