-
Task
-
Resolution: Unresolved
-
Minor
-
None
I have small code,
Which loops on Array and pass its element to shell script :- Works Fine
Where If I have HashMap and after loops I am passing Keys to Shell script or bat or Powershell it throws and error Why ?
// stage('Validation'){ steps{ script{ test1 = ["elem1","elem2"] test2 = [key1:"value1", key2:"value2"] for(defaults in test1){ test=defaults echo "before shell====> ${test}" status = sh(returnStdout: true, script: """ echo "${test}" """).trim() } echo "======started next HashMAP loop===========" for(defaults in test2){ test=defaults.key echo "before shell====> ${test}" status = sh(returnStdout: true, script: """ echo "${test}" """).trim() } } } }
Now Output is :
Lastly in HashMap Loop I see this error, What Can be the fix ??:
Caused: java.io.NotSerializableException: java.util.LinkedHashMap$Entry