0

While checking quality gate status in pipeine, getting following error.

Pipeline Code is below

    stage('SonarQube') {
      // Run the maven build
            dir("xyz_7.6_Trunk/xyz-services"){


                sh ' mvn -f pom.xml clean install -Dapp.server=jboss org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar -Dsonar.host.url=http://10.11.135.66:9000 -Dsonar.scm.disabled=True -U' 

            }
            }

stage('Quality Gate') {
timeout(time: 1, unit: ‘HOURS’) {
def qg = waitForQualityGate()
if (qg.status != ‘OK’) {
error “Pipeline aborted due to quality gate failure: ${qg.status}”
}
}
}

Error log is below.

java.lang.NoSuchMethodError: No such DSL method 'Time' 'HOURS' found among steps [acceptGitLabMR, addBadge, addErrorBadge, addGitLabMRComment, addHtmlBadge, addInfoBadge, addShortText, addWarningBadge, ansiblePlaybook, ansibleTower, ansibleVault, archive, artifactPromotion, bat, build, catchError, checkout, createSummary, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, dockerNode, ec2, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, getContext, git, gitChangelog, gitlabBuilds, gitlabCommitStatus, input, isUnix, junit, library, libraryResource, load, mail, milestone, nexusArtifactUploader, nexusPolicyEvaluation, nexusPublisher, node, parallel, powershell, properties, pwd, readFile, readTrusted, removeBadges,  
ramsai
  • 15
  • 6

1 Answers1

0

As I see, you use scripted pipeline, so the syntax should be fine.

timeout functionality is implemented in Pipeline: Basic Steps plugin (part of Pipeline plugin). That's why I think that you need to reinstall those plugins and the issue should be fixed. Anyway, please check again the syntax of the timeout step.

biruk1230
  • 3,042
  • 4
  • 16
  • 29
  • I have tried different syntaxs for timeout. nothing is working. Pipeline: Basic Steps plugin is installed.. eventhough nt working. – ramsai Jan 31 '19 at 13:37