Reputation: 370
I already installed grade and set up in the environment variable PATH
even I am getting an error.
gradle.bat is not recognized as an internal or external command in Jenkins
the configuration is
and the default task is in build.gradle is
task build{
dependsOn copyDocsSetup
}
while I am building using Jenkin I am getting an error like the below
Started by user ajay
Building in workspace C:\Program Files (x86)\Jenkins\workspace\ARS BUILD
[Gradle] - Launching build.
[ARS BUILD] $ cmd.exe /C "gradle.bat -b '"C:\Program Files (x86)\Jenkins\workspace\ARS BUILD\gradleBuildScript\BuildARSSystem\ARSBuild\build.gradle"' && exit %%ERRORLEVEL%%"
'gradle.bat' is not recognized as an internal or external command,
operable program or batch file.
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE
how to solve it, I am very new in Jenkins world. thanks in advance.
Upvotes: 1
Views: 7451
Reputation: 2115
Adding a Gradle installation in your global Jenkins configuration should fix your problem.
But a better solution is to use the Gradle wrapper. See the relevant section on the Gradle wrapper in the Gradle User Guide for how to configure it. The Gradle wrapper will automatically download the correct Gradle version, so you don't have to install one yourself on the Jenkins machine.
Upvotes: 5