eclipse创建maven工程时报错

问题描述

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就没有问题了

解决方案

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

解决方案二:

试下使用maven 更新下工程呢?

解决方案三:

eclipse 运行Maven时报错总结
eclipse 下创建maven web工程

解决方案四:

本机安装的maven是3.2.2
eclipse是4.5
m2e是1.2

时间: 2025-01-13 04:35:08

eclipse创建maven工程时报错的相关文章

Maven常见问题之Eclipse创建Maven工程,pom.xml报错的解决办法

需要稍等片刻哦....

jeecg-eclipse的maven导入时报错

问题描述 eclipse的maven导入时报错 第一次装maven,按步骤是装好了.导入第一个maven项目就报错了,求大神不吝赐教! 以下是错误提示 Errors occurred during the build. Errors running builder 'Maven Project Builder' on project 'jeecg'. Could not calculate build plan: Plugin org.apache.maven.plugins:maven-res

【Maven由浅入深】3.在Eclipse中创建maven工程

紧接着上一篇,下面我们来学习如何在Eclispe(MyEclipse)中创建Maven工程. 如果我们使用的是光秃秃的eclipse(最原始的),那么我们要为eclipse下载一个插件,即是m2eclipse 我使用的是MyEclipse8.5版本,其中已经安装好了Maven插件. 打开我们的MyEclipse,我们点击Windows选项,然后选择Preferences选项,然后我们可以看到里面有一个Maven选项: 这是Myeclipse直接给我们的Maven,这个Maven我们是不能直接使用

[Maven实战](4)eclipse创建Maven项目

介绍前面Hello World项目的时候,并没有涉及IDE,这样一个简单的项目,使用最简单的编辑器也能完成.但是对一个稍微大一些的项目来说,还是推荐使用IDE.这一篇文章我们在m2eclipse帮助下使用eclipse创建Maven项目. 1. 创建 使用IDE创建一个Maven项目非常简单,选择菜单项File->New->Other,在弹出的对话框中选择Maven下的Maven Project,然后点击Next按钮. 图1 在弹出的New Maven Project对话框中,使用默认的选项.

azure-请教一下,我在Azure上创建映像时报错。有哪位遇到到过,小弟刚接触Azure不熟悉。

问题描述 请教一下,我在Azure上创建映像时报错.有哪位遇到到过,小弟刚接触Azure不熟悉. 解决方案 您好, 请问你是怎样上传你的vhd文件的? 根据你提供的错误消息,请尝试使用Add-AzureVMImage PowerShell cmdlet来替代Windows Azure管理界面来添加图像: Add-AzureVMImage -ImageName -MediaLocation<图像所在的物理blob page的位置> -OS https://msdn.microsoft.com/e

eclipse建maven工程包名结构错误

问题描述 eclipse建maven工程包名结构错误 在java视图下,包结构是这样的,求解原因 解决方案 在eclipse中选中package右键 选择build path-> Use as Source folder 即可变成资源文件夹

MyEclipse中创建Maven工程

首先要在Myeclipse中进行maven的设置 1. 2. 这里可以选择对应的内存大小 3. 4. 至此MyEclipse对Maven的支持设置完毕 下面我们就在MyEclipse中创建一个maven标准的web工程: 6. 如果建完项目后,出现错误The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path解决方法如下: 右击web工程--->属性或者build pat

【maven 报错】maven项目执行maven install时报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)

  在使用maven新建的web项目中,执行   执行如上的这两个操作,报错: 1 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project bioligyInfo: Fatal error compiling: tools.jar not found: C:\Program Files\Java\jre1.8.0

eclipse创建maven项目

1.打开eclipse,文件-新建-其他,选择Maven Project   2.第一个打上勾,并输入存储目录 3.下一步,这里的Packing 选择 war的形式   4.由于packing是war包,那么下面也就多出了webapp的目录   5.由于我们的项目要使用eclipse发布到tomcat下面,这里我们需要先把项目转成dynamic web project   在我们的项目上点击右键,选择properties 并找到 Project Facets ,并点击Convert to fac