wesker0918 2015-07-15 00:42 采纳率: 50%
浏览 11417
已采纳

eclipse创建maven工程时报错

使用的是官方的Eclipse中自带的m2e插件,创建maven项目时就弹出个错误
图片说明
在pom.xml文件那会显示个红X,提示如下:
Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (execution: default-testCompile, phase: test-
compile)
- Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6
or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-plugin-api:jar:2.0.6, org.apache.maven:maven-
project:jar:2.0.6, org.apache.maven:maven-profile:jar:2.0.6, org.apache.maven:maven-artifact-manager:jar:2.0.6, org.apache.maven:maven-plugin-registry:jar:2.0.6,
org.apache.maven:maven-core:jar:2.0.6, org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.6, org.apache.maven:maven-repository-metadata:jar:2.0.6,
org.apache.maven:maven-error-diagnostics:jar:2.0.6, org.apache.maven:maven-plugin-descriptor:jar:2.0.6, org.apache.maven:maven-artifact:jar:2.0.6, org.apache.maven:maven-
settings:jar:2.0.6, org.apache.maven:maven-model:jar:2.0.6, org.apache.maven:maven-monitor:jar:2.0.6, org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:
Failure to transfer org.apache.maven:maven-plugin-api:jar:2.0.6 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted
until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-plugin-api:jar:2.0.6 from/to central
(https://repo.maven.apache.org/maven2): The operation was cancelled. (org.apache.maven.plugins:maven-resources-plugin:2.6:resources:default-resources:process-resources)
org.apache.maven.plugin.PluginExecutionException: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources failed: Plugin
org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-
plugin-api:jar:2.0.6, org.apache.maven:maven-project:jar:2.0.6, org.apache.maven:maven-profile:jar:2.0.6, org.apache.maven:maven-artifact-manager:jar:2.0.6,
org.apache.maven:maven-plugin-registry:jar:2.0.6, org.apache.maven:maven-core:jar:2.0.6, org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.6,
org.apache.maven:maven-repository-metadata:jar:2.0.6, org.apache.maven:maven-error-diagnostics:jar:2.0.6, org.apache.maven:maven-plugin-descriptor:jar:2.0.6,
org.apache.maven:maven-artifact:jar:2.0.6, org.apache.maven:maven-settings:jar:2.0.6, org.apache.maven:maven-model:jar:2.0.6, org.apache.maven:maven-monitor:jar:2.0.6,
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1: Failure to transfer org.apache.maven:maven-plugin-api:jar:2.0.6 from https://repo.maven.apache.org/
maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not
transfer artifact org.apache.maven:maven-plugin-api:jar:2.0.6 from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled. at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106) at
org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331) at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362) at
org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112) at
org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360) at
org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52) at
org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137) at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172) at
org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:
115) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod
$1.call(MavenBuilder.java:105) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99) at org.eclipse.m2e.core.internal.builder.MavenBuilder
$BuildMethod.execute(MavenBuilder.java:86) at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200) at org.eclipse.core.internal.events.BuildManager
$2.run(BuildManager.java:734) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:205)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:245) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:300) at
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303) at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:359) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:382) at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235) at
org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-resources-
plugin:2.6 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-plugin-api:jar:2.0.6, org.apache.maven:maven-
project:jar:2.0.6, org.apache.maven:maven-profile:jar:2.0.6,

请问如何解决?谢谢

本机安装的maven是3.2.2
eclipse是4.5

m2e是1.2

最后也不知道什么原因,重新下了eclipse就没有问题了

展开全部

  • 写回答

6条回答 默认 最新

  • Evankaka 博客专家认证 2015-07-15 01:22
    关注

    有可能是maven的版本太高了。eclipse哪个版本的。maven哪个版本的

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)
编辑
预览

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥100 如何快速统计出一亿行由0和1组成的数字里面的1连续出现几次及标记后出现的次数?
  • ¥15 include 头文件引用出错问题
  • ¥15 MATLAB并行池出问题
  • ¥15 本地运行成功上传到洛谷上却WA?
  • ¥15 断网的时候检测socket连接状态
  • ¥15 Jenkins执行bat指令时报错
  • ¥15 基于FPGA的算法实现
  • ¥15 在AST抽象语法图构建CFG图时 如何构建的
  • ¥15 关于#r语言#的问题:R语言GSVA函数调用失效q生信求解:这个GSVA的包,看了一下说是函数调用过期失效了,现在需要套用新模版公式,有没有解答的呀
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部