Troubleshooting Jenkins Typo Errors with example
pipeline {
agent any
stages {
stage(‘Build’) {
steps {
sh ‘mvn compule’
}
}
}
}
sh step where the command “mvn compile” is misspelled as “mvn compule”. This will result in a typo error when the Jenkins build execute.
it might show “groovy.lang.MissingPropertyException: No such property: compule for class: groovy.lang.Binding”.
Correct the typo by replacing it with the correct command “mvn compile”. The corrected code should look like this.
pipeline {
agent any
stages {
stage(‘Build’) {
steps {
sh ‘mvn compile’
}
}
}
}