Linux下运行maven编译出错

语言他浮夸 发布于 2016/06/14 15:23
阅读 498
收藏 0

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:

 

 

加载中
0
灯光下的宁静
灯光下的宁静
你用的maven版本是?
语言他浮夸
语言他浮夸
3.1.1版本的,jdk是1.6
0
阿信sxq
阿信sxq
你缓存的resources插件有问题,找到它,删除了,让它重新下载,找不到的话,就把缓存库一起全部删除吧
阿信sxq
阿信sxq
回复 @史帅峰 : 你删除的是你本地及其还是私服里面的?本地有的话是不会从服务器下载的哦
语言他浮夸
语言他浮夸
回复 @阿信sxq : 现在连公司的私服,把原来仓库里的东西全删了。可还是报这个错误。
阿信sxq
阿信sxq
回复 @语言他浮夸 : “公司服务器的仓库”,这个仓库是什么,应该就是一个nexus吧,要不然你怎么搞的?
语言他浮夸
语言他浮夸
回复 @阿信sxq : 我刚接触maven,公司同事给我说的就是要我下班回家后,下载相应的插件到本地仓库,然后再把我下载好的拷贝到公司服务器的仓库。至于那个代理应该是没有设置,公司没有设置私服,所以我就不知道这么解决了。
阿信sxq
阿信sxq
回复 @语言他浮夸 : 下载的时候网络不好,就会出现下载的文件有错误。公司应该搭建一个nexus代理吧 ,要不然太不专业了
下一页
返回顶部
顶部