在清理和构建NetBeans maven项目时,它会在特定项目位置之外的其他位置搜索pom.xml

时间:2016-02-27 21:18:46

标签: java maven netbeans

NetBeans显示错误:

The goal you specified requires a project to execute but there is no POM in this directory (D:\Java\Programmes). Please verify you invoked Maven from the correct directory. -> [Help 1]
org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory (D:\Java\Programmes). Please verify you invoked Maven from the correct directory.
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:89)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    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)

它显示了此错误,因为我正在尝试在D:\Current Work\Maven Test中清理和构建项目,但netbeans在D:\Java\Programmes中搜索项目,如果我尝试使用{{1}编译同一项目在命令提示符下,它编译正常并在mvn compile中创建目标文件夹。任何人都可以帮助我了解NetBeans在清理和构建的不同位置搜索maven项目的确切问题。

提前致谢:)

0 个答案:

没有答案