How does Jenkins discover the config.jelly for a post-build plugin?

↘锁芯ラ 提交于 2019-12-10 11:08:15

问题


I'm creating a post-build plugin for some customized reports in my company. I started with the Jenkins "hello world" example provided here:

https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial

This worked great. I was able to load the plugin and use it in my Jenkins instance without any problem.

To get things going for my project, I was able to move the HelloWorldBuilder to another folder than the default one the Jenkins HPI setup created, build, and upload this plugin with no problem. I was also able to change this to derive from the hudson.tasks.Recorder and changed the @Extension to derive from BuildStepDescriptor as well. This all built fine, I was able to upload the hpi file to Jenkins no problem, and was able to use the plugin in the post-build steps as expected. At this point things are moving along great and I made the mistake of starting to think this was going to be a breeze.

When I attempted to rename the class from "HelloWorldBuilder" I started having problems. I see the plugin as a post-build step still, but no longer able to configure it. I tried moving the config.jelly class and corresponding help html files to a new directory based upon the new class name which did not work as well. I've tried several combinations of path structure and naming conventions based upon other forums, other plugin repos, and documentation I found, but to no avail.

I'm not certain what I'm missing here so my question is this: Exactly how does Jenkins discover the config.jelly file based upon the class implementing the post-build plugin for various combinations of plugin/class names and directory structures?


回答1:


According Jenkins docs, your config.jelly should be placed in a package named after your Extension, eg: if your class is foo.bar.Extension, then config.jelly must be placed as src/main/resources/foo/bar/Extension/config.jelly



来源:https://stackoverflow.com/questions/29424226/how-does-jenkins-discover-the-config-jelly-for-a-post-build-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!