El lunes, 8 de junio de 2020, 19:38:15 (UTC+2), Jérôme Godbout escribió:
>
> Sounds like you need to put the function where the sh is called into a
> @NonCPS decorator on that function.
>
>
>
> @NonCPS
>
> def MyFct() {
>
> sh(“ls”);
>
> }
>
>
>
> That should remove the need for serialization of that command ainto this
> function.
>
>
I have discovered it is an issue with ScriptSecurity plugin and
ActiveChoices. I have upgraded my jenkins but it is still happening.
I dont know why it is still giving me the exception. If i run the same
piece of code outside my pipeline, it works...
>
>
> *From:* [email protected] <javascript:> <
> [email protected] <javascript:>> *On Behalf Of *chencho m-a
> *Sent:* June 8, 2020 9:41 AM
> *To:* Jenkins Users <[email protected] <javascript:>>
> *Subject:* sh vs execute
>
>
>
> Hi all,
>
>
>
> I am suffering a weird issue with sh when i am calling a simple ls from a
> groovy script inside jenkins, but if I use execute().text, it works fine.
>
>
>
> Why does sh return java.lang.UNIXProcess an throw NonSerializableException
> and execute() works fine?
>
>
>
> thank you.
>
> --
> 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 [email protected] <javascript:>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/5f27436c-2c6b-4039-abfc-1496d239b981o%40googlegroups.com
>
> <https://groups.google.com/d/msgid/jenkinsci-users/5f27436c-2c6b-4039-abfc-1496d239b981o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/c7cdb67b-a13d-47b1-8531-dd2b345b6532o%40googlegroups.com.