I was running below code in jenkins buildflow . But when i run below code in groovy executor it worked fine for me
def generator = { String alphabet, int n ->
new Random().with {
(1..n).collect { alphabet[ nextInt( alphabet.length() ) ] }.join()
}
}
pattern = '0x' + generator( (('A'..'F')+('0'..'9')).join(), 16 )
plintln "Random Pattern Created :" + pattern
Getting following error
ERROR: Failed to run DSL Script
groovy.lang.MissingMethodException: No signature of method: com.cloudbees.plugins.flow.FlowDelegate.plintln() is applicable for argument types: (java.lang.String) values: [Random Pattern Created :0xAC0E837A5284A407]
Possible solutions: println(java.lang.String), println(), println(java.io.PrintWriter), println(java.lang.Object), print(java.lang.Object), printf(java.lang.String, [Ljava.lang.Object;)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
at com.cloudbees.plugins.flow.FlowDelegate.methodMissing(FlowDSL.groovy:485)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)