Uploaded image for project: 'Jenkins Events'
  1. Jenkins Events
  2. EVENTS-43

No job DSL method for 'version'

    XMLWordPrintable

Details

    • Task
    • Status: Done (View Workflow)
    • Blocker
    • Resolution: Won't Fix
    • other
    • Installed jenkins version 2.19.2, Almost all advance plugin, Centos 7jdk 1.8.101

    Description

      while running jenkins pipeline job it is shwoing job dsl method 'version()' is not found, Follwoing is the code

      sh "git config credential.username ${env.GIT_USERNAME}"
      sh "git config credential.helper '!echo password=\$GIT_PASSWORD; echo'"
      sh "git config user.name 'jenkins' "
      sh "git config user.email 'jenkins-gcs@example.com' "
      sh "mvn versions:set -DnewVersion=${version()}"
      sh "mvn -T 2C clean install"
      if (DO_DEPLOY == "true"){
      sh "git tag -a ${version()} -m 'Jenkins Build'"
      sh "GIT_ASKPASS=true git push origin ${version()}"
      if(gitBranch=="jenkins_slave")

      { echo "its master branch hence deploying.." sh "mvn deploy" }

      else{
      echo "stage build branch"+gitBranch
      sh "cd gcs-manifest-beanstalk"
      sh "mvn deploy"

      Attachments

        Activity

          danielbeck Daniel Beck added a comment -

          Almost all fields make no sense here. Please read https://wiki.jenkins-ci.org/display/JENKINS/How+to+report+an+issue

          danielbeck Daniel Beck added a comment - Almost all fields make no sense here. Please read https://wiki.jenkins-ci.org/display/JENKINS/How+to+report+an+issue

          People

            Unassigned Unassigned
            atulsharma1989 Atul Sharma
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: