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

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.


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.


On Windows when you are using PowerShell you have to enclose all parameters with quotes.

So if you want to create a maven webapp archetype you would do as follows:

Prerequisites:

  1. Make sure you have maven installed and have it in your PATH environment variable.

Howto:

  1. Open windows powershell
  2. mkdir MyWebApp
  3. cd MyWebApp
  4. mvn archetype:generate "-DgroupId=com.javan.dev" "-DartifactId=MyWebApp" "-DarchetypeArtifactId=maven-archetype-webapp" "-DinteractiveMode=false"

enter image description here

Note: This is tested only on windows 10 powershell

Tags:

Maven 3