Calling an existing plugin from mine

20 views
Skip to first unread message

Thom Ellis

unread,
Mar 16, 2015, 4:14:14 PM3/16/15
to jenkin...@googlegroups.com
This is probably a bit of a newbie question, but I haven't been able to find a good answer.  What is the proper way to implicitly call an existing plugin from within one I'm developing?

For example, just to play around with the idea, I was looking at the htmlpublisher plugin.  Let's say I know that my build is going to create an HTML report, so rather than have a user also enable the htmlpublisher plugin as a post-build step, I just want to do it myself.  I have it in my dependencies in my pom.xml, and Jenkins goes and downloads it fine (it does show up as an option in my project configuration for post-build step, and I can run it standalone and everything works properly.  So I tried just simply instantiating an htmlpublisher object, and then calling it's perform method.  This 'almost' works.  The plugin does run, and all the proper files are being created (perform method itself returns true), however the action doesn't seem to be recognized properly, the icon/url doesn't become visible on the project page.

What am I missing here?  Or am I doing this entirely incorrectly?

Thanks in advance!

Ivo Bellin Salarin

unread,
Mar 17, 2015, 2:35:07 AM3/17/15
to jenkin...@googlegroups.com

You have to add the action to the build, probably.


--
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/9f199182-55d7-48c5-a728-029e56b30689%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thom Ellis

unread,
Mar 19, 2015, 6:44:53 PM3/19/15
to jenkin...@googlegroups.com
Hi Ivo,

Thanks for the reply.  Ya you're right, it just wasn't obvious to me straight away what was necessary there.  The htmlpublisher plugin adds the action, so I assumed it would take care of itself, but since that was being added when jenkins requests the project actions, I needed to add that into my plugin.  Got it going now :) 

Regards,
--T
Reply all
Reply to author
Forward
0 new messages