maven3 - 获取mvn依赖的错误:tree命令

时间:2013-05-17 15:51:29

标签: maven-3

我有一个使用maven 3的项目。当我运行mvn dependency:tree命令时出现以下错误。有人可以建议我为什么会收到此错误?

“mvn -version” Apache Maven 3.0(r1004208; 2010-10-04 07:50:56-0400) Java版本:1.6.0_16

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.7:tree (default-cli) on project : Cannot build project dependency graph: org.apache.maven.project.MavenProject.getProjectBuildingRequest() -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.7:tree (default-cli) on project wesp-dgw: Cannot build project dependency graph
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:203)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:140)
    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:314)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:151)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:445)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:168)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:132)
    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:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot build project dependency graph
    at org.apache.maven.plugin.dependency.TreeMojo.execute(TreeMojo.java:233)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:195)
    ... 19 more
Caused by: org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException: org.apache.maven.project.MavenProject.getProjectBuildingRequest()
    at org.apache.maven.shared.dependency.graph.internal.Maven3DependencyGraphBuilder.buildDependencyGraph(Maven3DependencyGraphBuilder.java:92)
    at org.apache.maven.shared.dependency.graph.internal.DefaultDependencyGraphBuilder.buildDependencyGraph(DefaultDependencyGraphBuilder.java:63)
    at org.apache.maven.plugin.dependency.TreeMojo.execute(TreeMojo.java:216)
    ... 21 more
Caused by: java.lang.NoSuchMethodException: org.apache.maven.project.MavenProject.getProjectBuildingRequest()
    at java.lang.Class.getMethod(Class.java:1605)
    at org.apache.maven.shared.dependency.graph.internal.Maven3DependencyGraphBuilder.invoke(Maven3DependencyGraphBuilder.java:99)
    at org.apache.maven.shared.dependency.graph.internal.Maven3DependencyGraphBuilder.buildDependencyGraph(Maven3DependencyGraphBuilder.java:68)
    ... 23 more

1 个答案:

答案 0 :(得分:3)

maven 3.0.5的错误消失了。我不确定这是maven 3.0中的错误还是配置问题。