Where to place utility code used in several plugins?

12 views
Skip to first unread message

Ullrich Hafner

unread,
Nov 15, 2019, 12:57:43 PM11/15/19
to Jenkins Developers
I have some classes that I would like to use in several of my Jenkins plugins. Some classes are depending on Jenkins core, some classes only use JRE dependencies. Up to now I duplicated these classes by copying them into the corresponding plugins -  but this is ugly and error prone.

What is the preferred way of handling theses classes? Should I create two new modules (util and plugin-utill) that will host theses classes? Or is this just overkill? Or should I better host them in my GitHub account and publish them to Maven central (or any other hosting service) on my own?  



Legend:
- blue: my existing plugins
- yellow: my existing library (hosted in jenkisci)
- orange: my planned libraries (plugin-util has Jenkins dependency, util not)
 

Jesse Glick

unread,
Nov 15, 2019, 3:39:00 PM11/15/19
to Jenkins Dev
On Fri, Nov 15, 2019 at 12:57 PM Ullrich Hafner
<ullrich...@gmail.com> wrote:
> What is the preferred way of handling theses classes? Should I create two new modules (util and plugin-utill) that will host theses classes?

Keep it simple. The latter should be a plugin
(`<packaging>hpi</packaging>`), and both should be hosted in
@jenkinsci.

Oleg Nenashev

unread,
Nov 18, 2019, 6:44:36 AM11/18/19
to Jenkins Developers
+1 for a "just plugin"
Reply all
Reply to author
Forward
0 new messages