Jenkins插件显示在“插件"页面上,但不显示在配置页面上 [英] Jenkins plugin shows on Plugin page but does not show on configuration page

查看:398
本文介绍了Jenkins插件显示在“插件"页面上,但不显示在配置页面上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过遵循

I am creating a hello world plugin for Jenkins by following Tutorial: Create a Jenkins Plugin to integrate Jenkins and Nexus Repository. After I followed the steps, I can run Jenkins and test the plugin.

它显示在已安装的插件"页面上.

It shows on Installed Plugin Page.

然后我转到配置"页面,希望看到下图所示的Hello World Builder部分,但没有.

Then I go to Configuration page and expect to see Hello World Builder section like the below image, but there is not.

我错过了哪些步骤?在将该插件显示在配置页面上之前,我需要做些什么吗?

What steps did I miss? Is there anything I have to do before having that plugin show up on the configuration page?

更新 这是项目布局,我还没有对其进行任何修改.

Update This is the project layout, I haven't modified anything on it yet.

推荐答案

您使用了什么命令来生成插件框架?

What command did you use to generate the plugin skeleton?

仅供参考,不建议使用上述教程中的mvn -cpu.

FYI, from the tutorial above, mvn -cpu is deprecated.

要生成插件框架,请使用:

To generate the plugin skeleton, use:

mvn hpi:create

mvn -U org.jenkins-ci.tools:maven-hpi-plugin:create 插件指南

我将包括对我有用的每一步:

I'm going to include each step for what worked for me:

  1. mvn hpi:create,然后输入groupId(按Enter使用默认值: org.jenkins-ci.plugins )和artifactId(插件名称)
  2. cd new-plugin-name
  3. mvn eclipse:eclipse
  4. mvn package
  5. mvn hpi:run (默认端口为8080,但您可以使用Dport选项设置自己的端口(即mvn hpi:run -Dport=9999,如果正在使用端口8080,请使用此端口,否则mvn hpi:run将会失败)
  6. 打开浏览器并输入URL"localhost:8080"(或9999)
  7. 您应该在下面的页面.单击链接,您将带您到Jenkins主页
  8. 点击管理Jenkins">配置系统".向下滚动到页面底部附近,您应该看到Hello World Builder部分
  9. 返回Jenkins主页,然后单击新建项目"
  10. 为项目提供任何名称,选择"Freestyle Project",然后单击确定".
  11. 向下滚动到构建"部分,然后单击添加构建步骤">向世界问好
  12. 输入名称(即TestName),保存项目,然后运行构建(立即构建")
  13. 在构建历史记录">控制台输出下单击最新的构建.
  1. mvn hpi:create, then enter groupId (press enter to use default: org.jenkins-ci.plugins) and artifactId (name of the plugin)
  2. cd new-plugin-name
  3. mvn eclipse:eclipse
  4. mvn package
  5. mvn hpi:run (default port is 8080, but you can set your own with Dport option (i.e. mvn hpi:run -Dport=9999, use this if port 8080 is in use - otherwise mvn hpi:run will fail)
  6. Open browser and enter URL "localhost:8080" (or 9999)
  7. You should the page below. Click the link and that'll take you to Jenkins home page
  8. Click 'Manage Jenkins' > Configure System. Scroll down near the bottom of the page and you should see the Hello World Builder section
  9. Go back to Jenkins home page and click New Item
  10. Give the project any name, select Freestyle Project, click OK.
  11. Scroll down to the Build section and click 'Add build step' > Say hello world
  12. Enter a name (i.e. TestName), save the project, then run a build ('Build Now')
  13. Click on the latest build under 'Build History' > Console Output.

这篇关于Jenkins插件显示在“插件"页面上,但不显示在配置页面上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆