如何部署 Jenkins 扩展点

How to deploy Jenkins extension point

我正在尝试为 dependency graph view plugin 写一个扩展点。

我阅读了有关扩展点的文档,但没有找到如何部署我的实现。 我想我需要以某种方式引用原始插件来获取实现方法(我如何获取它 - 它在罐子里吗?它是 jpl 吗?)

然后我自己写代码。 怎么办? 创建我自己的罐子?我应该把它放在哪里? 我需要更改 Jenkins 配置中的任何内容吗?

如果您有一些扩展 Jenkins 扩展点的代码,则应将此代码打包并部署为 Jenkins 插件。


通常您从 Hello World Plugin and read this 开始,然后再重复任何工作

One of Jenkins' main strengths is its plugins (and their openness). Over a thousand are already available, and brand new plugins become available every week or so. As such, there's quite likely one or more plugins which cover your needs.

In case some existing plugins partly cover your needs, we encourage you to contribute directly to these plugins rather than starting new ones from scratch. Profusion of plugins is good, profusion of plugins doing the same thing or so is not as good

一旦你有了想要分享的东西,你就可以在 Jenkins Developer Forum 上请求将其分叉到 jenkins github 仓库 - 你可能应该在 github 上的其他地方开发开始。

如果您想将其他 jenkins 插件包含到您的插件中,那么您可以将它们包含在 POM 中

  <dependency>
         <groupId>org.jenkins-ci.plugins</groupId>
         <artifactId>script-security</artifactId>
         <version>1.13</version>
  </dependency>

如图POM for the Matrix Project Plugin

jenkins github 回购是寻找示例的好地方