There is a well known problem with .each in Pipeline right now that Kohsuke
is working on. There are many comments here:

https://issues.jenkins-ci.org/browse/JENKINS-26481

On Thu, Apr 21, 2016 at 1:33 PM, ok999 <nirish.ok...@gmail.com> wrote:

> This a very basic test code for the pipleine job
>
>
> node('windows') {
> checkout([$class: 'GitSCM', branches: [[name: '*/master']],
> doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [],
> userRemoteConfigs: [[credentialsId: 'cca9c557-65b8-4c72-9176-f78d', url:
> 'g...@github.com:SomeProjects/trobocopy.git']]])
>
>
> def pathMap = ['folder1':'dst1', 'folder2':'dst2', 'folder3':'dst3',
> 'folder4':'dst4']
>   pathMap.each { path, dir ->
>        bat "xcopy %cd%${path} C:\\${dir} /E /Y /V"
>          }
> }
>
>
> The jenkins console shows
>
> [Pipeline] End of Pipelinejava.io.NotSerializableException: 
> java.util.LinkedHashMap$Entry
>       at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
>       at 
> org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
>       at 
> org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
>       at 
> org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
>       at 
> org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
>       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:343)
>       at java.util.HashMap.writeObject(HashMap.java:1129)
>       at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:606)
>
>
>
>
> Caused by: an exception which occurred:
>       in field locals
>       in field parent
>       in field capture
>       in field def
>       in field closures
>       in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@4d0c20da
> Finished: FAILURE
>
> --
> 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-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/cbe33a56-beab-414f-9302-8044e1e1a8f4%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/cbe33a56-beab-414f-9302-8044e1e1a8f4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrick Wolf
Sr. Product Manager
CloudBees

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAGDV0P-nfgZcokq84CL-4oCXjv1fzHb9BCNB6y0Pv6wtxUeKdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to