Hey, seems like I managed to add my plugin to Artifactory. But it does not appear in the Jenking plugin manager, or the plugin page:
How do I make the artefact also available for everyone to download?
@MarkEWaite unfortunately i’ve experienced this issue in all of its varieties during my own plugin development.
There are basically 4 options.
option 1: ensure everything you’re going to assign to a variable during hte course of pipeline execution serializable. this sometimes isn’t feasible or is a huge level of effort
which leads to option 2: simply don’t assign non-serializable objects to variables and always infer their value like youre doing with
alternatively, Option 3, you try to do non-serializable things in methods annotated
@NonCPS but you should not try to run pipeline code in non-cps transformed methods. it leads to strange behavior.
and then finally, a hacky work around.. Option 4: set the pipeline’s durability to PERFORMANCE_OPTIMIZED. this isn’t a scalable solution though. basically - the exception is being thrown when groovy-cps tries to persist the pipeline’s state to disk. Setting the durability to PERFORMANCE_OPTIMIZED makes this happen significantly less frequently. therefore - the pipeline never attemps to serialize the non-serializable variable meaning the exception is not thrown.