Welcome to the Linux Foundation Forum!

Jenkins Pipeline Error Expected Stage Missing, but not missing

Hi, i get this error:

WorkflowScript: 7: Expected a stage @ line 7, column 1.
stage("build"){

Thats my (already on VS Code "groovy" linted Jenkinsfile using a plugin to send to server to activate linting check from J Server)

pipeline {
agent any
tools {
maven 'maven 3.6.1'
}
stages {
stage('build') {
steps {
echo 'Compiling worker app'
dir('worker') {
sh 'mvn compile'
}
}
}
stage('test') {
steps {
echo 'Running Unit Tests on worker app'
}
}
stage('package') {
steps {
echo 'Packaging worker app'
}
}
}
post {
always {
echo 'Building multibranch pipeline for worker is completed..'
}
}
}

What I dont understand is that I have a stage step. It tells me its missing and the pipeline fails. It was also not working with double quotes. I guess all closing brackets are also there. Maybe someone has an idea.

Answers

  • i agree it does not look linted anymore, hahaha. but it is in VS CODE.

  • all right. Issue can be closed. :) I forgot to save after linting. I work as Frontend Engineer and i have hot module reloading that I am used to and just forgot to save. haha. After linting everything works fine. But maybe this thread can help someone in the future who did not lint.

  • Hi @basticloud,

    I'm glad that you were able to solve it!

    For next time it will be useful to include the Chapter and Section or Lab you are working on, so I can try to reproduce the issue.

    Regards,
    Luis.

Categories

Upcoming Training