How about shared libraries? https://www.jenkins.io/doc/book/pipeline/shared-libraries/
On Mon, Dec 14, 2020 at 10:55 AM Charles Moulliard <[email protected]> wrote: > Hi, > > How can we Import a java jar on jenkins in order to allow a Groovy Script > part of a Job DSL to use java classes packaged within the jar file ? > > Example of groovy script using the Java class Hello and method "message" > > package groovy > import dev.snowdrop.jenkins.Hello; > println new Hello().message(); > > Cheers > > Charles > > -- > 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/d28daa31-1da7-423c-ab7c-f14820f985ecn%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/d28daa31-1da7-423c-ab7c-f14820f985ecn%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/CAMMhyA3fPuwCxwsaOMb7NWj2zs1jSYFzVGOz8%3DUC2ZLX0pgE6w%40mail.gmail.com.
