I have a pom.xml
in C:\\Users\\AArmijos\\Desktop\\Factura Electronica\\MIyT\\componentes-1.0.4\\sources\\pom.xml
and I executed:
mv
In my case, its because I copied pasted the command from the browser and it turned out that the dash was not the ASCII dash, just delete and type the dash again.
http://www.toptip.ca/2017/04/maven-most-weird-error-causing-failure.html
Changing mvn clean
to mvn clean --file *.pom
fixed this issue for me.
The execution of maven command required pom.xml file that contains information about the project and configuration details used by Maven to build the project. It contains default values for most projects.
Make sure that porject should contains pom.xml at the root level.
Adding one more answer for Windows users. If none of this solves the problems.
Do not add space
before or after =
-DgroupId= com.company.module //Wrong , Watch the space after the equal to
-DgroupId=com.company.module //Right
Its better to put everything inside double quotes, like "-DgroupId=com.." This will give you exact error rather than some random error.
Weird that , maven does not even care to mention this in the documentation.
I got this error suddenly in Netbeans (but it worked from the command line) and it turns out some other program had changed the default directory of the command prompt. And because Netbeans runs "cmd /c" when invoking maven, it starts in an incorrect directory.
Check out in Regedit the value for
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\Autorun
If it has been set, you probably should remove it to fix the problem. (1)
(I landed here when trying to resolve this issue, might not be 100% applicable to the current question - but might help others)
(1) Changing default startup directory for command prompt in Windows 7
"The goal you specified requires a project to execute": The answer is in your question. I faced the same issue. Run the "mvn command" within the project folder, Also make sure sure its a maven configured project and hence contains the "POM.xml" file and you should be good to go!