Idea 中编译maven项目报错:[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3

这篇具有很好参考价值的文章主要介绍了Idea 中编译maven项目报错:[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

编译报错如下:

com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) No implementation for MavenResourcesFiltering was bound.
  while locating ResourcesMojo

1 error

======================
Full classname legend:
======================
MavenResourcesFiltering: "org.apache.maven.shared.filtering.MavenResourcesFiltering"
ResourcesMojo:           "org.apache.maven.plugins.resources.ResourcesMojo"
========================
End of classname legend:
========================

ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources (default-resources) on project myJavaProject: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources failed: Unable to load the mojo 'resources' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-resources-plugin:3.3.0': com.google.inject.ProvisionException: Unable to provision, see the following errors:
[ERROR] 
[ERROR] 1) No implementation for MavenResourcesFiltering was bound.
[ERROR]   while locating ResourcesMojo
[ERROR]   at ClassRealm[plugin>org.apache.maven.plugins:maven-resources-plugin:3.3.0, parent: Launcher$AppClassLoader@18b4aac2]
[ERROR]       \_ installed by: WireModule -> PlexusBindingModule
[ERROR]   while locating Mojo annotated with @Named(value=org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources)
[ERROR] 
[ERROR] 1 error
[ERROR] 
[ERROR] ======================
[ERROR] Full classname legend:
[ERROR] ======================
[ERROR] Launcher$AppClassLoader: "sun.misc.Launcher$AppClassLoader"
[ERROR] MavenResourcesFiltering: "org.apache.maven.shared.filtering.MavenResourcesFiltering"
[ERROR] Mojo:                    "org.apache.maven.plugin.Mojo"
[ERROR] Named:                   "com.google.inject.name.Named"
[ERROR] PlexusBindingModule:     "org.eclipse.sisu.plexus.PlexusBindingModule"
[ERROR] ResourcesMojo:           "org.apache.maven.plugins.resources.ResourcesMojo"
[ERROR] WireModule:              "org.eclipse.sisu.wire.WireModule"
[ERROR] ========================
[ERROR] End of classname legend:
[ERROR] ========================
[ERROR] 
[ERROR]       role: org.apache.maven.plugin.Mojo
[ERROR]   roleHint: org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/PluginContainerException

Process finished with exit code 1

[WARNING] 
[WARNING] Some problems were encountered while building the effective settings
[WARNING] expected START_TAG or END_TAG not TEXT (position: TEXT seen ...<!--\u963f\u91cc\u4e91\u955c\u50cf-->\n    <mirror>\ua0\ua0\n\ua0\ua0\ua0\ua0\ua0\ua0<i... @162:9)  @ G:\myLibrary\maven\apache-maven-3.9.2-bin\apache-maven-3.9.2\conf\settings.xml, line 162, column 9
[WARNING] expected START_TAG or END_TAG not TEXT (position: TEXT seen ...<!--\u963f\u91cc\u4e91\u955c\u50cf-->\n    <mirror>\ua0\ua0\n\ua0\ua0\ua0\ua0\ua0\ua0<i... @162:9)  @ C:\Users\Scott\.m2\settings.xml, line 162, column 9
[WARNING] 
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------------< com.songj:myJavaProject >-----------------------
[INFO] Building myJavaProject 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- resources:3.3.0:resources (default-resources) @ myJavaProject ---
[WARNING] Error injecting: org.apache.maven.plugins.resources.ResourcesMojo
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) No implementation for MavenResourcesFiltering was bound.
  while locating ResourcesMojo

1 error

======================
Full classname legend:
======================
MavenResourcesFiltering: "org.apache.maven.shared.filtering.MavenResourcesFiltering"
ResourcesMojo:           "org.apache.maven.plugins.resources.ResourcesMojo"
========================
End of classname legend:
========================

    at com.google.inject.internal.InternalProvisionException.toProvisionException (InternalProvisionException.java:251)
    at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1104)
    at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1139)
    at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
    at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:86)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57)
    at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:67)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:109)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:124)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
    at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:62)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47)
    at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1101)
    at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
    at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)
    at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:494)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:114)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:910)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.186 s
[INFO] Finished at: 2023-06-29T17:01:52+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources (default-resources) on project myJavaProject: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources failed: Unable to load the mojo 'resources' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-resources-plugin:3.3.0': com.google.inject.ProvisionException: Unable to provision, see the following errors:
[ERROR] 
[ERROR] 1) No implementation for MavenResourcesFiltering was bound.
[ERROR]   while locating ResourcesMojo
[ERROR]   at ClassRealm[plugin>org.apache.maven.plugins:maven-resources-plugin:3.3.0, parent: Launcher$AppClassLoader@18b4aac2]
[ERROR]       \_ installed by: WireModule -> PlexusBindingModule
[ERROR]   while locating Mojo annotated with @Named(value=org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources)
[ERROR] 
[ERROR] 1 error
[ERROR] 
[ERROR] ======================
[ERROR] Full classname legend:
[ERROR] ======================
[ERROR] Launcher$AppClassLoader: "sun.misc.Launcher$AppClassLoader"
[ERROR] MavenResourcesFiltering: "org.apache.maven.shared.filtering.MavenResourcesFiltering"
[ERROR] Mojo:                    "org.apache.maven.plugin.Mojo"
[ERROR] Named:                   "com.google.inject.name.Named"
[ERROR] PlexusBindingModule:     "org.eclipse.sisu.plexus.PlexusBindingModule"
[ERROR] ResourcesMojo:           "org.apache.maven.plugins.resources.ResourcesMojo"
[ERROR] WireModule:              "org.eclipse.sisu.wire.WireModule"
[ERROR] ========================
[ERROR] End of classname legend:
[ERROR] ========================
[ERROR] 
[ERROR]       role: org.apache.maven.plugin.Mojo
[ERROR]   roleHint: org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/PluginContainerException

Process finished with exit code 1

本人idea版本2023.1   ;本地maven版本3.9.1;jdk版本1.8。

主要原因就是idea版本与maven版本、项目中maven-plugin版本不匹配,可以调整自己的本地maven版本解决此问题。我是把自己的maven版本降低到3.3.9,编译通过。

附可参考:

​注意:针对一些老项目 还是尽量采用 3.6.3版本,针对idea各个版本的兼容性就很兼容​​(版本问题并未验证,工作时候使用Maven的时候有类似问题,就记录了下来,从网上抄来的,看看就行)
​ ​IDEA 2022 兼容Maven 3.8.1及之前的所用版本​​
​ ​IDEA 2021 兼容Maven 3.8.1及之前的所用版本​​
​ ​IDEA 2020 兼容Maven 3.6.3及之前所有版本​​
​ ​IDEA 2018 兼容Maven3.6.1及之前所有版本

maven官网下载

maven 不同版本下载文章来源地址https://www.toymoban.com/news/detail-672621.html

到了这里,关于Idea 中编译maven项目报错:[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包