Discard old builds: how to plug a different BuildDiscarder?

52 views
Skip to first unread message

martinda

unread,
Feb 5, 2018, 5:22:18 PM2/5/18
to Jenkins Developers
Hi,

I would like to implement a slightly modified build retention policy, and I do not get how to plug a different BuildDiscarder into the core. For example, if I have a modified version of:
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/tasks/LogRotator.java

then I'd like to register it so it becomes available as an option. How would I do that?

Thanks,
Martin

Daniel Beck

unread,
Feb 5, 2018, 5:26:24 PM2/5/18
to Jenkins Developers

> On 5. Feb 2018, at 23:22, martinda <martin....@gmail.com> wrote:
>
> then I'd like to register it so it becomes available as an option. How would I do that?

Have an inner DescriptorImpl class (of the appropriate descriptor type) and add an @Extension annotation.

https://jenkins.io/doc/developer/extensibility/

Reply all
Reply to author
Forward
0 new messages