package Util
public class Util {
public static def sayHello() {
println "Hello"
}
}
TestDSL.groovy looks like
package Tests
import static Utils.Util.*
sayHello()
//dsl chopped off as it is irrelevant hereI get the following error on running TestDSL.groovy in Jenkins:workspace:<path-to-project>/jobs/Tests/TestDSL.groovy: 2: unable to resolve class Utils.Util @ line 2, column 1. import static Utils.Util.*1 errorAlso my load rule is:load <path-to-jobs>\jobs\TestsCan I please get some suggestions to workaround this issue?Thanks.
- import Utils.* or import Utils.Util
- I dont think you need to set 'the Additional classpath' option in the Process Job DSLs build step pointing to the location of your class since that package is located in the root folder.
Cheers
I hope we should use
Import static Utils.utils
Thanks
Sai kishore Amirishetty
--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugin+unsubscribe@googlegroups.com.
To post to this group, send email to job-dsl-plugin@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/40de5051-d3a3-4156-b6f9-0b22887f44d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.