BLO
BLO

Reputation: 1

Maven POM confusion

I'm unable to run any command in Maven without receiving the following message:

The goal you specified requires a project to execute but there is no POM in this directory . Please verify you invoked Maven from the correct directory.

This happens even when attempting to run these commands, which are intended to CREATE a POM.

mvn -B archetype:generate \ -DarchetypeGroupId=org.apache.maven.archetypes \ -DgroupId=com.mycompany.app \ -DartifactId=my-app

I'm following the steps here, http://maven.apache.org/guides/getting-started/ and I started from the very beginning. I'm really not sure how to get past this if there's no way for me to set up a POM initially, can anyone help me out?

Upvotes: 0

Views: 111

Answers (3)

SubOptimal
SubOptimal

Reputation: 22993

Seems you are on Windows. There you must use the carret ^ instead of the backslash \ to wrap a long command line

for Windows

mvn -B archetype:generate ^
  -DarchetypeGroupId=org.apache.maven.archetypes ^
  -DgroupId=com.mycompany.app ^
  -DartifactId=my-app

for Linux

mvn -B archetype:generate \
  -DarchetypeGroupId=org.apache.maven.archetypes \
  -DgroupId=com.mycompany.app \
  -DartifactId=my-app

Upvotes: 1

ACV
ACV

Reputation: 10560

Copy and paste this into notepad and remove all \ characters so that you get one long line. Then paste in cmd. Should work. And the message you are seeing usually means that you try to run mvn from a folder which does not contain pom.xml

Upvotes: 0

Andres
Andres

Reputation: 10727

Remove the "\" characters, and try again.

Upvotes: 0

Related Questions