Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "The goal you specified requires a project to execute but there is no POM in this directory" after executing maven command

Tags:

maven-3

I have a pom.xml in C:\Users\AArmijos\Desktop\Factura Electronica\MIyT\componentes-1.0.4\sources\pom.xml and I executed:

mvn install:install-file -DgroupId=es.mityc.jumbo.adsi -DartifactId=xmlsec-1.4.2-ADSI -Dversion=1.0 -Dpackaging=jar -Dfile=C:\Users\AArmijos\Desktop\Factura Electronica\MIyT\componentes-1.0.4\core\xmlsec-1.4.2-ADSI-1.0.jar

however it returned the error below:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.310s
[INFO] Finished at: Thu May 02 16:48:29 COT 2013
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM
 in this directory (C:\Users\AArmijos). Please verify you invoked Maven from the
 correct directory. -> [Help 1]

Can someone explain why it fails?

like image 770
Adrian Avatar asked Oct 18 '22 13:10

Adrian


People also ask

Where is POM XML in Maven?

It is fundamental unit of work in Maven. It is an XML file that resides in the base directory of the project as pom. xml. The POM contains information about the project and various configuration detail used by Maven to build the project(s).

How do you make a POM file?

Creating a new Maven POM is just a matter of selecting a project, entering the Group Id, Artifact Id, Version, choosing the Packaging type, and providing a Name into the fields provided and m2eclipse. Click the Next button to start adding dependencies.


2 Answers

This link helped: https://stackoverflow.com/a/11199865/1307104

I edit my command by adding quotes for every parameter like this:

mvn install:install-file "-DgroupId=org.mozilla" "-DartifactId=jss" "-Dversion=4.2.5" "-Dpackaging=jar" "-Dfile=C:\Users\AArmijos\workspace\componentes-1.0.4\deps\jss-4.2.5.jar"

It's worked.

like image 257
Adrian Avatar answered Oct 21 '22 01:10

Adrian


For any of those who are experiencing this on Windows and none of the above worked, try running this from cmd.exe. Executing these commands via PowerShell caused the install to fail each time.

like image 62
Josh Sullivan Avatar answered Oct 21 '22 03:10

Josh Sullivan