No such DSL method 'post' found

48 views
Skip to first unread message

Indra Gunawan

unread,
Oct 4, 2017, 1:23:31 PM10/4/17
to Jenkins Users
Hi,

I would like to archive build images files produced after a successful build step/stage in Jenkins pipeline.
Is "post", the declarative pipeline syntax, the only way to have post-build defined in Jenkins pipeline.

Somehow it is not available on the Jenkins environment I have:

java.lang.NoSuchMethodError: No such DSL method 'post' found among steps ...

May I know the plug-in and version of the plug-in that needs to be installed and running?
Can declarative style and old style coexist in the same pipeline script?


The Jenkins I am running is :  CloudBees Jenkins Enterprise 2.46.3.2-rolling

Thank you
-Indra

Robert Hales

unread,
Oct 4, 2017, 1:52:18 PM10/4/17
to Jenkins Users
Sounds like you are trying to use Post in the wrong place - most likely in a scripted pipeline. If you were using it correctly, but it wasn't available, the error message would say something about an "Undefined Section". You can't use "post" in a scripted pipeline. Instead, you have to use a try/catch/finally. 
Reply all
Reply to author
Forward
0 new messages