Gradlew Jenkins pipeline

Gradlew runs on the Ubuntu server just fine. When calling ./gradlew --help from a test script in the Jenkins pipeline it runs fine. When calling a task from the build.gradle file however it fails with the error:

Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory()

Any insight to a solution would be appreciated.

Hi Dan,

it may be that the home directory set for the user running Gradle is not writable. A stack trace for the error you are seeing would be helpful to get a better idea what is wrong.