编译报错如下:

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 不同版本下载

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐