栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Jenkins开发Plugin

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Jenkins开发Plugin

一、设置maven依赖


D:Summer.XiaWorkspaceSoftwareapache-maven-3.6.0Repository
  
    org.jenkins-ci.tools
  
  
    
    
      jenkins
      
        true 
      
      
        
          repo.jenkins-ci.org
          http://repo.jenkins-ci.org/public/
        
      
      
        
          repo.jenkins-ci.org
          http://repo.jenkins-ci.org/public/
        
      
    
  
  
    
      repo.jenkins-ci.org
      http://repo.jenkins-ci.org/public/
      m.g.o-public
    
  

二、利用maven创建插件
C:Summer.XiaWorkspaceGitee>java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
C:Summer.XiaWorkspaceGitee>mvn hpi:create
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-hpi-plugin:1.114-cloudbees-1:create (default-cli) @ standalone-pom ---


### 输入 groupId artifactId  相关信息
Enter the groupId of your plugin [org.jenkins-ci.plugins]: my-jenkins-
plugin
Enter the artifactId of your plugin (normally without '-plugin' suffix): hello-world


[INFO] Defaulting package to group ID + artifact ID: hello-world.my-jenkins-plugin
[WARNING] Package name contains invalid characters. Replacing it with 'helloworld.myjenkinsplugin'
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating Archetype: maven-hpi-plugin:1.114-cloudbees-1
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: basedir, Value: C:Summer.XiaWorkspaceGitee
[INFO] Parameter: package, Value: helloworld.myjenkinsplugin
[INFO] Parameter: groupId, Value: hello-world
[INFO] Parameter: artifactId, Value: my-jenkins-plugin
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] ********************* End of debug info from resources from generated POM ***********************
[INFO] Archetype created in dir: C:Summer.XiaWorkspaceGiteehello-world
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  18.983 s
[INFO] Finished at: 2022-04-26T15:58:01+08:00
[INFO] ------------------------------------------------------------------------

三、启动插件

启动前需要下载依赖jenkins依赖包,且保证http://repo.jenkins-ci.org可以访问,如访问不了请使用maven代理服务器。

 

通过链接访问jenkins: http://localhost:8080/jenkins

 

 

四、代码地址

https://gitee.com/xiaxinyu3_admin/hello-world-plugin.githttps://gitee.com/xiaxinyu3_admin/hello-world-plugin.git

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/835927.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号