Linux下运行maven编译出错

发布于 2021-11-29 19:31:44 字数 7426 浏览 791 评论 7

mvn compile 执行出错

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources) on project xdrMSPortal: 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': com.google.inject.ProvisionException: Guice provision errors:
[ERROR]
[ERROR] 1) Error injecting: protected org.apache.maven.shared.filtering.MavenResourcesFiltering org.apache.maven.plugin.resources.ResourcesMojo.mavenResourcesFiltering
[ERROR] while locating org.apache.maven.plugin.resources.ResourcesMojo
[ERROR] at ClassRealm[plugin>org.apache.maven.plugins:maven-resources-plugin:2.6, parent: sun.misc.Launcher$AppClassLoader@546b97fd]
[ERROR] while locating org.apache.maven.plugin.Mojo annotated with @com.google.inject.name.Named(value=org.apache.maven.plugins:maven-resources-plugin:2.6:resources)
[ERROR]
[ERROR] 1 error
[ERROR] role: org.apache.maven.plugin.Mojo
[ERROR] roleHint: org.apache.maven.plugins:maven-resources-plugin:2.6:resources: Can not set org.apache.maven.shared.filtering.MavenResourcesFiltering field org.apache.maven.plugin.resources.ResourcesMojo.mavenResourcesFiltering to org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources) on project xdrMSPortal: 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.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: 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:120)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more
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:492)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:97)
        ... 20 more
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting: protected org.apache.maven.shared.filtering.MavenResourcesFiltering org.apache.maven.plugin.resources.ResourcesMojo.mavenResourcesFiltering
  while locating org.apache.maven.plugin.resources.ResourcesMojo
  at ClassRealm[plugin>org.apache.maven.plugins:maven-resources-plugin:2.6, parent: sun.misc.Launcher$AppClassLoader@546b97fd]
  while locating org.apache.maven.plugin.Mojo annotated with @com.google.inject.name.Named(value=org.apache.maven.plugins:maven-resources-plugin:2.6:resources)

1 error
      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:264)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:252)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:459)
        ... 21 more
Caused by: com.google.inject.ProvisionException: Guice provision errors:

 

 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

葬花如无物 2021-12-04 21:02:58

回复
下载的时候网络不好,就会出现下载的文件有错误。公司应该搭建一个nexus代理吧 ,要不然太不专业了

冬天旳寂寞 2021-12-04 06:33:14

回复
我刚接触maven,公司同事给我说的就是要我下班回家后,下载相应的插件到本地仓库,然后再把我下载好的拷贝到公司服务器的仓库。至于那个代理应该是没有设置,公司没有设置私服,所以我就不知道这么解决了。

把回忆走一遍 2021-12-04 06:06:03

回复
“公司服务器的仓库”,这个仓库是什么,应该就是一个nexus吧,要不然你怎么搞的?

只为守护你 2021-12-04 02:09:19

回复
现在连公司的私服,把原来仓库里的东西全删了。可还是报这个错误。

緦唸λ蓇 2021-12-03 04:37:09

回复
你删除的是你本地及其还是私服里面的?本地有的话是不会从服务器下载的哦

因为看清所以看轻 2021-12-03 01:13:41

你缓存的resources插件有问题,找到它,删除了,让它重新下载,找不到的话,就把缓存库一起全部删除吧

毁梦 2021-12-02 19:08:17

你用的maven版本是?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文