Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mvn command returns: [ERROR] The goal you specified requires a project to execute but there is no POM in this directory

Creating a project with archetype:generate in the same way as described in Maven in 5 Minutes.
Got this error:

[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/mnt/c/Users/etomort/quartz-poc). 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 (/mnt/c/Users/etomort/quartz-poc). Please verify you invoked Maven from the correct directory.

Since it is such a basic thing, I just got confused...

I checked these two questions:

  • Error “The goal you specified requires a project to execute but there is no POM in this directory” after executing maven command
  • maven generating pom file

But neither the accepted answers solved the issue.
So, I am creating this question in case someone hits it and do not get it at first.

By the way, the Maven command entered is:

mvn archetype:generate -DgroupId=com.mycompany -DartifactId=quartz-poc -DarchetypeArtifactId= maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false  
like image 668
nephewtom Avatar asked Jan 25 '23 07:01

nephewtom


1 Answers

If you are on Windows and using the cmd command line or PowerShell, you need to wrap the arguments in quotes:

mvn archetype:generate "-DgroupId=com.mycompany" "-DartifactId=quartz-poc" "-DarchetypeArtifactId=maven-archetype-quickstart" "-DarchetypeVersion=1.4" "-DinteractiveMode=false"

On some machines, It works without the quotes on the cmd though.

like image 189
Nasser Boukehil Avatar answered Jan 27 '23 22:01

Nasser Boukehil