'mvn.bat' is not recognized as an internal or external command

1,182 views
Skip to first unread message

shekhar sharma

unread,
Jun 9, 2015, 12:19:14 PM6/9/15
to jenkins...@googlegroups.com
I have configured a maven project with Jenkins. But while doing build now it is failing with the error attached in text file. Even though Maven is configured correctly and i am able to run the same project from command window with the commands 'mvn test'. Please help if anybody have any idea.
Build error.txt

Slide

unread,
Jun 9, 2015, 12:20:33 PM6/9/15
to jenkins...@googlegroups.com
Did you setup the Maven information in the global config? Also, are you running the commands on the command line as the same user that Jenkins is running under?

On Tue, Jun 9, 2015 at 9:19 AM shekhar sharma <sharmas...@gmail.com> wrote:
I have configured a maven project with Jenkins. But while doing build now it is failing with the error attached in text file. Even though Maven is configured correctly and i am able to run the same project from command window with the commands 'mvn test'. Please help if anybody have any idea.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5a87a70f-99db-4239-915c-64610bb60a3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vincent Latombe

unread,
Jun 9, 2015, 1:25:55 PM6/9/15
to Jenkins Users
If you run maven 3.3.x the wrapper is named mvn.cmd now, I don't think the mvn build step has been updated accordingly. Use mvn 3.2.x or use the regular batch command line as a workaround.

Vincent

Arnaud Héritier

unread,
Jun 9, 2015, 1:43:16 PM6/9/15
to jenkins...@googlegroups.com
It seems your are relying on a locally installed maven distribution. Your Jenkins probably doesn't have the same %PATH% than your shell. Try to give it the absolute path to your installation

Advice : Use the Maven installer and runner (in a freestyle job) provided by Jenkins to simplify your life

Cheers

On Tue, Jun 9, 2015 at 6:19 PM, shekhar sharma <sharmas...@gmail.com> wrote:
I have configured a maven project with Jenkins. But while doing build now it is failing with the error attached in text file. Even though Maven is configured correctly and i am able to run the same project from command window with the commands 'mvn test'. Please help if anybody have any idea.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5a87a70f-99db-4239-915c-64610bb60a3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-----
Arnaud Héritier
Mail/GTalk: aheritier AT gmail DOT com
Twitter/Skype : aheritier

shekhar sharma

unread,
Jun 9, 2015, 2:42:02 PM6/9/15
to jenkins...@googlegroups.com
Thank you all, for taking time to look into this and for the suggestions.

1. It is freestyle job only.
2. Yes, I am able to run the same maven command(mvn test) from cmd window and projects runs fine.
3. Yes, I am using the local installation and MAVEN_HOME and path are configured correctly.
4. Vincent, You were right that ver 3.2.x has mvn.bat. So, I have downgraded the version to 3.2.x and configured all the required paths in env variable as well as in jenkins. But no luck. :(

Please find the screen shot  of jenkins config and let me know if i am missing something there or need to update something else.

Thanks.
Jenkins-Maven-Config.png
Reply all
Reply to author
Forward
0 new messages