Gradle task not found in root project
Where you run a program from is different from the active directory when you run the command. You need to set into the directory before you run the command. If you are using a freestyle job, I believe you would want to set the root directory to tell gradle where your build file is.
Pedro Pinto
Updated on June 13, 2022Comments
-
Pedro Pinto almost 2 years
I'm using Jenkins to build a project. My build process is done through gradlew.
I set the gradlew location to:
/var/jenkins_home/workspace/project/X/Y/Z/projectname/gradlew build javadoc
My build fails with this error:
Task 'javadoc' not found in root project 'project'
.This means that Jenkins is trying to execute my task from the directory
/var/jenkins_home/workspace/project/
instead of/var/jenkins_home/workspace/project/X/Y/Z/projectname/
.I don't understand how Jenkins is executing a task from the wrong directory. Any input on this issue is appreciated!
-
Pedro Pinto over 6 yearsRight! I forgot to change the advanced gradlew configuration "Root Build script". Thank you :)