Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-57934

Cannot set URL variable in pipeline: you tried to assign a value to the class 'java.net.URL'

XMLWordPrintable

      With the following Jenkinsfile I get an error complaining that you tried to assign a value to the class 'java.net.URL'

      pipeline {
          environment {
              URL = "http://foomybar.com"
          }
          agent any
          stages {
              stage ("do the thing") {
                  steps {
                      sh "echo ${env.URL}"
                  }
              }
          }
      }
      

      I cannot set the URL environment variable through the environment block.

            Unassigned Unassigned
            ovidiub13 Ovidiu-Florin Bogdan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: