简体   繁体   中英

groovy.lang.MissingMethodException: No signature of method: in groovy on jenkins buildflow

I am trying to run below code in jenkins build flow

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

output is below

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.cod ehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)

Please read the output (typo):

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM