Hi Charles,

I think you can do this using the third party library @Grab [1]. I have
taken a look in the documentation of Grape [2] and I see they use a custom
Maven repository to load the libraries.

[1]
https://www.jenkins.io/doc/book/pipeline/shared-libraries/#using-third-party-libraries
[2]
https://docs.groovy-lang.org/latest/html/documentation/grape.html#_quick_start

Hth,

Nick Stolwijk

~~~ Try to leave this world a little better than you found it and, when
your turn comes to die, you can die happy in feeling that at any rate you
have not wasted your time but have done your best ~~~

Lord Baden-Powell


On Mon, Dec 14, 2020 at 4:55 PM Charles Moulliard <cmoul...@redhat.com>
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 jenkinsci-users+unsubscr...@googlegroups.com.
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAA9S6i65jEc_vvDMovZqbCjX2L1W3WE2TABNJ295EZXPzS4jYg%40mail.gmail.com.

Reply via email to