MrStack
MrStack

Reputation: 465

MissingProjectException by Maven in Netbeans 7.x

When I try to either Build, Clean and Build or Run (play button) my 'Maven Webapplication' in NetBeans, I get the following output:

cd E:\Dev\Apps\2012_2013\MyApp; JAVA_HOME=E:\\Apps\\Dev\\jdk7u5 "\"E:\\Apps (x86)\\Dev\\NetBeans7.0.1\\java\\maven\\bin\\mvn.bat\"" install -e
Error stacktraces are turned on.
Scanning for projects...
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 0.138s
Finished at: Mon Oct 22 13:16:36 CEST 2012
Final Memory: 2M/15M
------------------------------------------------------------------------
The goal you specified requires a project to execute but there is no POM in this directory (E:\). 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 (E:\). 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:319)
    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)

Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException 

This is what I have tried to fix the problem:

My projects used to build and run perfectly with no problems when I was using NetBeans 7.0.1, until I installed NetBeans 7.2. That's when I started getting this error. I do have a POM file in my project. The error doesn't go away no matter what I try.

Other strange behavior:

What works:

Specs:

Upvotes: 3

Views: 8252

Answers (4)

Ishant
Ishant

Reputation: 1

In my case the network was the problem. The firewall was blocking the connection and causing the issue.

Upvotes: -1

HbnKing
HbnKing

Reputation: 1882

I had the same problem when I started tomcat in maven (linux) and then it throw this tipsenter link description here

and then i find the problem you have to tell Maven explicitly where the POM to build resides like this: mvn -f path/to/pom.xml ...

Upvotes: 2

vaclamar
vaclamar

Reputation: 165

I had the same problem when I set command promp default directory in the windows register to E:\ according: http://www.sevenforums.com/customization/77997-change-command-prompt-default-directory.html

After I deleted this regkey netbeans worked right for me.

Upvotes: 1

Rob
Rob

Reputation: 2666

It's a long shot but this worked for me:

I had the same problem, I got a new working station (with Windows 8 64bit). I tried to build my EJB and got the same exception you did.

I knew my projects dir was in the My Documents dir, I also knew that this dir was actually redirected to the server. This seemed to be the problem I have my projects somewhere local now and everything builds OK.

Upvotes: 0

Related Questions