Some questions on plugin development

29 views
Skip to first unread message

Jochen Wiedmann

unread,
Dec 20, 2017, 2:04:16 PM12/20/17
to Jenkins Developers

Hi,

I'd like to create a Jenkins plugin. However, I have some questions, hopefully you are able to help me with:

- My plugin A is designed to provide an extension for an extension point, which is defined by plugin B (existing).
- My understanding is, that I simply create a subclass of the extension point class, which in turn implements
  hudson.ExtensionPoint. No annotations, or something like that?
- Í assume, that I declare the jar files of B in my plugin as Maven dependencies with scope "provided", so that
  the necessary API is present at compile time.
- However, I do not understand, how dependency resolution works at runtime. Am I supposed to declare that
  plugin B must be in the classpath of plugin A? If so: How do I do that? Or, is there some magic, I am unaware
  of?
- Finally: I'd like to configure my plugin with some config files location. How would I do that? (Preferrably without
  some UI, I am trying to keep things simple.

Thanks,

Jochen

Jesse Glick

unread,
Dec 20, 2017, 4:05:49 PM12/20/17
to Jenkins Dev
On Wed, Dec 20, 2017 at 2:04 PM, Jochen Wiedmann
<jochen....@gmail.com> wrote:
> My plugin A is designed to provide an extension for an extension point,
> which is defined by plugin B (existing).
> - My understanding is, that I simply create a subclass of the extension
> point class, which in turn implements
> hudson.ExtensionPoint. No annotations, or something like that?

`@Extension`

> Í assume, that I declare the jar files of B in my plugin as Maven
> dependencies with scope "provided", so that
> the necessary API is present at compile time.

No, use `compile` scope (i.e., do not specify `<scope>` at all).

> I'd like to configure my plugin with some config files location.
> How would I do that?

You would not.

> Preferrably without
> some UI, I am trying to keep things simple.

`GlobalConfiguration`

Daniel Beck

unread,
Dec 20, 2017, 6:35:01 PM12/20/17
to jenkin...@googlegroups.com

> On 20. Dec 2017, at 20:04, Jochen Wiedmann <jochen....@gmail.com> wrote:
>
> No annotations, or something like that?


https://jenkins.io/doc/developer/extensibility/ explains this and links to relevant Javadoc (the developer docs on jenkins.io are work in not-much-progress, but this is mostly covered -- and there are references to previous docs on the wiki for every topic we have docs on).

Jesse Glick

unread,
Dec 21, 2017, 9:40:56 AM12/21/17
to Jenkins Dev
On Wed, Dec 20, 2017 at 4:05 PM, Jesse Glick <jgl...@cloudbees.com> wrote:
>> Preferrably without
>> some UI, I am trying to keep things simple.
>
> `GlobalConfiguration`

BTW

https://github.com/jenkinsci/archetypes/blob/master/README.md#usage

Ullrich Hafner

unread,
Dec 21, 2017, 10:53:20 AM12/21/17
to Jenkins Developers

Am 21.12.2017 um 15:40 schrieb Jesse Glick <jgl...@cloudbees.com>:

On Wed, Dec 20, 2017 at 4:05 PM, Jesse Glick <jgl...@cloudbees.com> wrote:
Preferrably without
some UI, I am trying to keep things simple.

`GlobalConfiguration`


signature.asc
Reply all
Reply to author
Forward
0 new messages