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.