Hello All,
I'm using Groovy 2.2.2 on Windows 7 64-bit. My Java version is 1.7.0_45
I'm using the @Grab annotation to grab things I need to run my scripts, and it dutifully downloads everything I put in my annotations, which I can verify in ~/.groovy/grapes (really %UserProfile%.groovy\grapes).
I'm programmatically using TestNG and ReportNG, and I'm using the latest versions (testng-6.8.8.jar and reportng-1.1.4.jar - I removed testng-6.8.5 from GROOVY_HOME/lib).
When I try to run my testRunner.groovy file, it downloads the jars and complained about not finding com.google.inject.Module, so I added guice-2.0, and it also in fact is properly installed in by grapes folder.
If I run this code in groovy, the output shows nothing related to grapes (not sure if it should)
def printClassPath(classLoader) {
println "$classLoader"
classLoader.getURLs().each {url->
println "- ${url.toString()}"
}
if (classLoader.parent) {
printClassPath(classLoader.parent)
}
}
printClassPath this.class.classLoader
so, even though it downloaded and installed the jar in the grapes folder properly, it doesn't find it. IF, however, I simply copy guice-2.0.jar to GROOVY_HOME/lib, everything works.
The goal is to run this from jenkins, and after I copied the file above, it works fine from jenkins, but I want the Grapes functionality so rolling out new slaves is simpler affair.
And thoughts on what it is I'm missing about how this should work?
Thanks!
A couple of things to note:
testng-6.8.8.jar and reportng-1.1.4.jar are not in my GROOVY_HOME/lib folder, they are only in the ~/.groovy/grapes folder, and they resolve just fine! Also, I have no ~/.groovy/lib, so I've verified that there not extra jar files floating around.