The "tools" block in a declarative pipeline gets silently ignored when not at same level as the agent clause

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      The attached Jenkinsfile's "tools" block does not add the JDK's path to the PATH variable as expected.

      Workarounds:

      • Moving the "agent {label 'abc && def'}" line up to replace the top-level "agent none" results in the path to the JVM being set properly.
      • Moving the "tools" block up to line 6 so that it is at the same level as theĀ "agent {label 'abc && def'}" clause alsoĀ results in the path to the JVM being set properly.

      Please consider improving the usability here. It seems like if Jenkins is unable to honor a "tools" block that it shouldn't silently proceed. If it had printed an error stating that the tools block has to be associated to a new node allocation this would have been a quick problem to resolve.

      Ā 

            Assignee:
            Unassigned
            Reporter:
            Gordon Daugherty
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: