Groovy Scripts

37 views
Skip to first unread message

Gilad Baruchian

unread,
May 18, 2015, 5:00:12 AM5/18/15
to jenkin...@googlegroups.com
I have groovy scripts that work in my jenkins instance.
I would like to be able to also run them from IntelliJ, but it seems like i need the jenkins jars for the imports to work (for example import hudson.model.*).

1. How can I get all the Jars I need to run jenkins groovy code?
2. Do you know of any good tutorials to learn about using the jenkins libraries ?

Thanks.

Robert Sandell

unread,
May 18, 2015, 5:29:46 AM5/18/15
to jenkin...@googlegroups.com
1. I usually create an empty plugin project and add dependencies to any plugins that I need to access.

2. There are more than a thousand code examples here https://github.com/jenkinsci ;)

/B

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/ccd43ad5-c03c-4e33-8baf-5125d777474b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Robert Sandell
Software Engineer
CloudBees Inc.

Gilad Baruchian

unread,
May 18, 2015, 6:56:32 AM5/18/15
to jenkin...@googlegroups.com
Thank you Robert!
I am assuming you are talking about maven dependencies, how do I add the dependencies for a plugin? 

Baptiste Mathus

unread,
May 18, 2015, 7:41:29 AM5/18/15
to jenkin...@googlegroups.com
I think Robert is answering the 2/ point. Maven dependencies are actually the same. Jenkins typical packaging uses Maven. Adding a plugin as a dependency will package the plugin with the related plugin as required (or not if you use the optional tag).

As for the 1/ point. I think the only reasonable solution is to use the jenkins-cli with the groovy or groovysh commands.

Cheers

2015-05-18 12:56 GMT+02:00 Gilad Baruchian <gila...@gmail.com>:
Thank you Robert!
I am assuming you are talking about maven dependencies, how do I add the dependencies for a plugin? 

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !
Reply all
Reply to author
Forward
0 new messages