I installed Tomcat 7 on Windows 8 on which Jenkins is deployed. I configured JDK, Ant and Maven in Jenkin settings. In the Maven section, I gave the name LocalMaven and MAVEN_HOME as C:\Techie\apache-maven . When I did the test build, it gave me the following error: mvn.bat is not recognized. Then I checked by entering the mvn command in CMD. He gave several maven statements, which means maven is available in PATH variables.
After googling, I changed MAVEN_HOME as **%M2_HOME%\bin** in the Jenkin-Maven configuration. However, this did not work.
LOG:
[workspace] $ cmd.exe /C '"mvn.bat -f HighScoresServiceClient compile && exit %%ERRORLEVEL%%"'
' mvn.bat ' is not recognized as an internal or external command, operating program or batch file
Build step ' Invoke top-level Maven targets ' marked as glitches
Finished: FAILURE
Edited: analysis added
The command executed by Jenkins, [workspace] $ cmd.exe /C '"mvn.bat -f String-replacer compile && exit %%ERRORLEVEL%%"' , where mvn.bat is not a valid command, so Jenkins makes the following mistake. that 'mvn.bat' is not recognized as an internal or external command, I think Jenkins should call the command as mvn, not mvn.bat. Can some experts correct me if I am wrong? Please let me know how to change this behavior if I am right.
Edited: tied to configuration 

source share