Maven之Unable to load the mojo 'resources' (or one of its required components)

原创 2017年09月11日 10:04:26

环境情况

Eclipse, Java项目

问题表现

Description Resource Path Location Type
Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources failed: Unable to load the mojo ‘resources’ (or one of its required components) from the plugin ‘org.apache.maven.plugins:maven-resources-plugin:2.6’ (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: Unable to load the mojo ‘resources’ (or one of its required components) from the plugin ‘org.apache.maven.plugins:maven-resources-plugin:2.6’
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:153)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331)
at org.eclipse.m2e.core.internal.embedder.MavenImpl11.call(MavenImpl.java:1362)atorg.eclipse.m2e.core.internal.embedder.MavenImpl11.call(MavenImpl.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
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.MavenBuilder1.method(MavenBuilder.java:172)atorg.eclipse.m2e.core.internal.builder.MavenBuilder1.method(MavenBuilder.java:1)
at org.eclipse.m2e.core.internal.builder.MavenBuilderBuildMethod11.call(MavenBuilder.java:115)atorg.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)atorg.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)atorg.eclipse.m2e.core.internal.builder.MavenBuilderBuildMethod1.call(MavenBuilder.java:105)atorg.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)atorg.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)atorg.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)atorg.eclipse.m2e.core.internal.builder.MavenBuilderBuildMethod.execute(MavenBuilder.java:86)
at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
at org.eclipse.core.internal.events.BuildManager2.run(BuildManager.java:735)atorg.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)atorg.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)atorg.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)atorg.eclipse.core.internal.events.BuildManager1.run(BuildManager.java:301)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:142)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:232)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: org.apache.maven.plugin.PluginContainerException: Unable to load the mojo ‘resources’ (or one of its required components) from the plugin ‘org.apache.maven.plugins:maven-resources-plugin:2.6’
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:551)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)
… 31 more
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException
role: org.apache.maven.plugin.Mojo
roleHint: org.apache.maven.plugins:maven-resources-plugin:2.6:resources
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:267)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:517)
… 32 more
Caused by: java.util.NoSuchElementException
at org.eclipse.sisu.plexus.RealmFilteredBeansFilteredItr.next(RealmFilteredBeans.java:118)atorg.eclipse.sisu.plexus.RealmFilteredBeansFilteredItr.next(RealmFilteredBeans.java:1)
at org.eclipse.sisu.plexus.DefaultPlexusBeansItr.next(DefaultPlexusBeans.java:76)atorg.eclipse.sisu.plexus.DefaultPlexusBeansItr.next(DefaultPlexusBeans.java:1)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
… 34 more
pom.xml /aifasion-web line 4 Maven Build Problem
Description Resource Path Location Type
Execution default-testResources of goal
org.apache.maven.plugins:maven-resources-plugin:2.6:testResources failed: Unable to load the mojo ‘testResources’ (or one of its required components) from the plugin ‘org.apache.maven.plugins:maven-resources-plugin:2.6’ (org.apache.maven.plugins:maven-resources-plugin:2.6:testResources:default-testResources:process-test-resources)
org.apache.maven.plugin.PluginExecutionException: Execution default-testResources of goal org.apache.maven.plugins:maven-resources-plugin:2.6:testResources failed: Unable to load the mojo ‘testResources’ (or one of its required components) from the plugin ‘org.apache.maven.plugins:maven-resources-plugin:2.6’
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:153)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331)
at org.eclipse.m2e.core.internal.embedder.MavenImpl11.call(MavenImpl.java:1362)atorg.eclipse.m2e.core.internal.embedder.MavenImpl11.call(MavenImpl.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
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.MavenBuilder1.method(MavenBuilder.java:172)atorg.eclipse.m2e.core.internal.builder.MavenBuilder1.method(MavenBuilder.java:1)
at org.eclipse.m2e.core.internal.builder.MavenBuilderBuildMethod11.call(MavenBuilder.java:115)atorg.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)atorg.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)atorg.eclipse.m2e.core.internal.builder.MavenBuilderBuildMethod1.call(MavenBuilder.java:105)atorg.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)atorg.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)atorg.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)atorg.eclipse.m2e.core.internal.builder.MavenBuilderBuildMethod.execute(MavenBuilder.java:86)
at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
at org.eclipse.core.internal.events.BuildManager2.run(BuildManager.java:735)atorg.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)atorg.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)atorg.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)atorg.eclipse.core.internal.events.BuildManager1.run(BuildManager.java:301)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:142)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:232)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: org.apache.maven.plugin.PluginContainerException: Unable to load the mojo ‘testResources’ (or one of its required components) from the plugin ‘org.apache.maven.plugins:maven-resources-plugin:2.6’
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:551)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)
… 31 more
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException
role: org.apache.maven.plugin.Mojo
roleHint: org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:267)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:517)
… 32 more
Caused by: java.util.NoSuchElementException
at org.eclipse.sisu.plexus.RealmFilteredBeansFilteredItr.next(RealmFilteredBeans.java:118)atorg.eclipse.sisu.plexus.RealmFilteredBeansFilteredItr.next(RealmFilteredBeans.java:1)
at org.eclipse.sisu.plexus.DefaultPlexusBeansItr.next(DefaultPlexusBeans.java:76)atorg.eclipse.sisu.plexus.DefaultPlexusBeansItr.next(DefaultPlexusBeans.java:1)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
… 34 more
pom.xml /aifasion-web line 4 Maven Build Problem

解决的办法

在Eclipse中,右击菜单, Maven–>Update Projects. 则问题会消失。

解决Maven报Plugin execution not covered by lifecycle configuration

Maven问题一直头疼着每一个开发人员
  • xxd851116
  • xxd851116
  • 2014年05月07日 11:25
  • 176427

Maven异常总结001---Maven project导入到myeclipse时候出现异常:could not get mojo execution paramater value

Maven project导入到myeclipse时候出现异常:could not get mojo execution paramater value 解决方案: 这时候发生了一个错...
  • lidew521
  • lidew521
  • 2017年03月15日 23:05
  • 756

myeclipse 使用maven出现的问题

1. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.4.1:resources ...
  • hzj9118
  • hzj9118
  • 2015年04月19日 16:50
  • 2651

PHP中出现“Unable to load dynamic library”问题的解决方法

startup: Unable to load dynamic library : PHP5\ext\php_mysql.dll 明明将extension_dir设置正确了还是提示无法找到dll...
  • lhl62411570
  • lhl62411570
  • 2013年02月17日 13:06
  • 18535

Maven的Mojo标注

每个Mojo都必须使用@g
  • jason5186
  • jason5186
  • 2014年10月06日 13:09
  • 2615

Maven 插件编写 之 初识 Mojo

Maven 作为一个优秀的项目管理工具,其插件机制为其功能扩展提供了非常大的便捷性。虽然说大多数情况下,我们可能不太会自己去编写 Maven 插件,但不排除在某些特殊的情况下,我们需要去完成一个自己的...
  • chinrui
  • chinrui
  • 2017年03月26日 13:28
  • 2890

gdal库的三个使用心得

gdal库的三个使用心得,关于创建金字塔、写入数据及投影转换的。
  • clever101
  • clever101
  • 2013年09月15日 23:34
  • 8440

[Android开发] Android Studio问题以及解决记录

1、真机运行报错Multi dex requires Build Tools 21.0.0 / Current: 19.1解决: 在项目 build.gradle 里面把classpath ‘com....
  • niubitianping
  • niubitianping
  • 2016年05月14日 01:28
  • 12189

Eclipse下的AndroidAnnotations的项目导入配置

使用AndroidAnnotations框架时,会减少代码的书写量,原理是提供一些引用代码直接使用时AndroidAnnotations框架会在后台自动编译即使生成部分代码,生成的代码可以再项目原路径...
  • yexiaosan123
  • yexiaosan123
  • 2016年11月23日 13:41
  • 816

CodeIgniter 核心代码阅读-加载语言包Lang.php

Lang.php--加载语言包Lang.php
  • zhxp_870516
  • zhxp_870516
  • 2013年06月03日 16:17
  • 2394
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Maven之Unable to load the mojo 'resources' (or one of its required components)
举报原因:
原因补充:

(最多只允许输入30个字)