import hudson.model.*
import jenkins.model.*
println("TESTING Groovy")
//The current build process:
def thr = Thread.currentThread()
def build = thr?.executable
/**
* VARIABLES
*/
def config = new HashMap()
def bindings = getBinding()
config.putAll(bindings.getVariables())
def buildMap = build.getBuildVariables()
config.putAll(buildMap)
def envVarsMap = build.parent.builds[0].properties.get("envVars")
config.putAll(envVarsMap)
println("TESTING Groovy")
config.keySet().each { key ->
println(key + ": " + config.get(key))
}
Caught: groovy.lang.MissingPropertyException: No such property: executable for class: java.lang.Thread groovy.lang.MissingPropertyException: No such property: executable for class: java.lang.Thread at hudson4234154804113492123.run(hudson4234154804113492123.groovy:10)
This is definitely a Groovy question, not a Jenkins question. I’d expect the same thing if you ran it at the command line. But I won’t send you away empty-handed.
The doc I’ve seen for Thread is:
http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html (java)
http://groovy.codehaus.org/groovy-jdk/java/lang/Thread.html (Groovy)
Neither one refers to “executable”. If you’re trying to find out the executable (likely “java”), I’m not sure how to help you off-hand. Maybe you can grovel through java.lang.System.properties?
--Rob
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/fa06fafc-9f6f-4cbb-a0cd-bdfca369bd56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Click here to report this email as spam.