I\'ve been using Maven on Git Bash (64-bit) for a few months now, and suddenly it stopped working, and is now generating this error on any maven command:
myu
The first thing to test is the %PATH%: in a CMD session, set up a simplified PATH.
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%
Note how the C:\WINDOWS\... paths are kept at the end of the PATH: that is important.
Then prepend the path of your %JAVA_HOME%\bin, and of <maven>\bin.
And make sure to set M2_HOME to C:\apache-maven-3.5.0.
Finally, test your mvn command, both in the current CMD, or (in that same Windows) in a git bash session (typing just "bash")
Finally, depending on your program and your brand of OS, don't forget that with Windows 10 you now have WSL and a full-fledge Linux bash. That can be a possible alternative.