Jenkins Pipeline (Workflow) Stage View disappears
<p>I have the problem, that in some Jenkins Pipeline projects the Stage View becomes invisible.</p>

<p>Usually, you can see the stage view between "Recent Changes" and "Permalinks". After some runs of a project, the Stage View disappears. If I clone the project, then the view is visible in the clone, but not in the original project.</p>

<p>It's a workaround to clone the project, but not a good one because I cannot replace the job every week.</p>

<p>Has someone seen that problem before and has an idea, how to fix that?</p>

<p>The stage view div, is on the job overview page, but it's not visible:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="cbwf-stage-view"&gt;
    &lt;div class="cbwf-widget cbwf-controller-applied pipeline-staged" objecturl="/user/myname/my-views/view/MaintainedByMe/job/Category/job/ProjectName/" fragcaption="Stage View" cbwf-controller="pipeline-staged"&gt;&lt;/div&gt;
    &lt;link rel="stylesheet" href="/adjuncts/ee6b655e/org/jenkinsci/pipeline/stageview_adjunct.css" type="text/css"&gt;
    &lt;script src="/adjuncts/ee6b655e/org/jenkinsci/pipeline/stageview_adjunct.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>My Jenkinsfile:</p>

<pre class="lang-groovy prettyprint-override"><code>def sonarHostUrl = 'http://sonar.host.url:1234'

node('Build') {
    echo "enforce a clear workspace:" // because there were some other problems
    deleteDir()

    stage('Checkout') {
        checkoutFromSVN()
    }
    stage('Compile') {
        mvn 'clean compile test-compile'
    }
    stage('Unit Tests') {
        mvn '-B org.jacoco:jacoco-maven-plugin:prepare-agent test'
        step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])
    }
    stage('Deploy to Nexus') {
        mvn 'install deploy -DskipTests'
        archiveArtifacts artifacts: '**/project-name*.jar', onlyIfSuccessful: false
    }
    stage('Local Integration Tests') {
        mvn '-B org.jacoco:jacoco-maven-plugin:prepare-agent-integration failsafe:integration-test failsafe:verify'
        step([$class: 'JUnitResultArchiver', testResults: '**/target/failsafe-reports/TEST-*.xml'])
    }
    stage('Sonar'){
        mvn "org.sonarsource.scanner.maven:sonar-maven-plugin:3.1.1:sonar -Dsonar.host.url=$sonarHostUrl"
    }
}
stage('Deploy to DEV') {
    build 'JobThatDeploysTheApplicationToDevEnv'
}
stage('Functional Tests') {
    build job: 'JobWithSoapUITests', parameters: [string(name: 'TESTENVIRONMENT', value: 'DEV')]
}

def checkoutFromSVN(){
    checkout([$class: 'SubversionSCM', 
            excludedCommitMessages: '.*\\[maven-release-plugin\\].*',
            locations: [[credentialsId: 'a1a2b3c4-1234-ab1d-b56c-0ac4bff23a6c', 
                       depthOption: 'infinity', 
                       ignoreExternalsOption: true, 
                       excludedRegions: 'Jenkinsfile',
                       local: 'project-dir', 
                       remote: 'https://url.to/project-dir']], 
            workspaceUpdater: [$class: 'CheckoutUpdater']])
}

def mvn(String args) {
    def mvnCmd = "${tool name: 'Maven 3.3.9', type: 'hudson.tasks.Maven$MavenInstallation'}/bin/mvn"

    wrap([$class: 'ConfigFileBuildWrapper', 
          managedFiles: [[
                    fileId: 'org.jenkinsci.plugins.configfiles.maven.GlobalMavenSettingsConfig1234567', 
                    targetLocation: '', // temporary file
                    variable: 'MAVEN_SETTINGS']]]) {
        bat "${mvnCmd} -s ${env.MAVEN_SETTINGS} ${args} -f project-dir/pom.xml"
    }
}
</code></pre>

<p>My Job configuration exported as XML:</p>

<pre class="lang-xml prettyprint-override"><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
&lt;flow-definition plugin="workflow-job@2.9"&gt;
  &lt;actions/&gt;
  &lt;description&gt;&lt;/description&gt;
  &lt;keepDependencies&gt;false&lt;/keepDependencies&gt;
  &lt;properties&gt;
    &lt;jenkins.model.BuildDiscarderProperty&gt;
      &lt;strategy class="hudson.tasks.LogRotator"&gt;
        &lt;daysToKeep&gt;-1&lt;/daysToKeep&gt;
        &lt;numToKeep&gt;10&lt;/numToKeep&gt;
        &lt;artifactDaysToKeep&gt;-1&lt;/artifactDaysToKeep&gt;
        &lt;artifactNumToKeep&gt;-1&lt;/artifactNumToKeep&gt;
      &lt;/strategy&gt;
    &lt;/jenkins.model.BuildDiscarderProperty&gt;
    &lt;org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty&gt;
      &lt;triggers&gt;
        &lt;hudson.triggers.TimerTrigger&gt;
          &lt;spec&gt;H H * * *&lt;/spec&gt;
        &lt;/hudson.triggers.TimerTrigger&gt;
        &lt;hudson.triggers.SCMTrigger&gt;
          &lt;spec&gt;H/10 7-18 * * *&lt;/spec&gt;
          &lt;ignorePostCommitHooks&gt;false&lt;/ignorePostCommitHooks&gt;
        &lt;/hudson.triggers.SCMTrigger&gt;
      &lt;/triggers&gt;
    &lt;/org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty&gt;
  &lt;/properties&gt;
  &lt;definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="workflow-cps@2.23"&gt;
    &lt;scm class="hudson.scm.SubversionSCM" plugin="subversion@2.6"&gt;
      &lt;locations&gt;
        &lt;hudson.scm.SubversionSCM_-ModuleLocation&gt;
          &lt;remote&gt;https://url.to/project-dir&lt;/remote&gt;
          &lt;credentialsId&gt;a1a2b3c4-1234-ab1d-b56c-0ac4bff23a6c&lt;/credentialsId&gt;
          &lt;local&gt;.&lt;/local&gt;
          &lt;depthOption&gt;infinity&lt;/depthOption&gt;
          &lt;ignoreExternalsOption&gt;true&lt;/ignoreExternalsOption&gt;
        &lt;/hudson.scm.SubversionSCM_-ModuleLocation&gt;
      &lt;/locations&gt;
      &lt;excludedRegions&gt;&lt;/excludedRegions&gt;
      &lt;includedRegions&gt;Jenkinsfile&lt;/includedRegions&gt;
      &lt;excludedUsers&gt;&lt;/excludedUsers&gt;
      &lt;excludedRevprop&gt;&lt;/excludedRevprop&gt;
      &lt;excludedCommitMessages&gt;&lt;/excludedCommitMessages&gt;
      &lt;workspaceUpdater class="hudson.scm.subversion.UpdateWithRevertUpdater"/&gt;
      &lt;ignoreDirPropChanges&gt;false&lt;/ignoreDirPropChanges&gt;
      &lt;filterChangelog&gt;false&lt;/filterChangelog&gt;
    &lt;/scm&gt;
    &lt;scriptPath&gt;Jenkinsfile&lt;/scriptPath&gt;
  &lt;/definition&gt;
  &lt;triggers/&gt;
&lt;/flow-definition&gt;
</code></pre>