Question

When I run this command:

mvn -e package 

I got this error:

[INFO] Error stacktraces are turned on. 
[DEBUG] Reading global settings from /usr/local/apache-maven-3.1.1/conf/settings.xml 
[DEBUG] Reading user settings from /root/.m2/settings.xml [DEBUG] Using local repository at /root/.m2/repository 
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /root/.m2/repository 
[INFO] Scanning for projects... 
[DEBUG] Extension realms for project org.apache.maven:standalone-pom:pom:1: (none) 
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null] 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 0.090s 
[INFO] Finished at: Thu Apr 24 11:47:01 CEST 2014 [INFO] Final Memory: 12M/362M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] The goal you specified requires a project to execute but there is no POM in 
this directory (/root/src/storm-starter). 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 
(/root/src/storm-starter). 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: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:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:606) 
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) 
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR]
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
Was it helpful?

Solution

Maven requires a file named pom.xml in the directory at which you have your project and are executing maven in.

That is the default; if you have another file as your pom.xml like you described in your comment, m2-pom.xml you'll have to inform maven about it with the -f flag.

mvn -f m2-pom.xml clean package
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top