1. 预备环境
artifactory ( 开源版本 )
maven  
jenkins 
jenkins artifactory plugin (在插件管理安装即可)
2. 配置artifactory 
 
a. maven local 仓库
jfrog artifactory  jenkins pipeline 集成
 
jfrog artifactory  jenkins pipeline 集成
jfrog artifactory  jenkins pipeline 集成
 
b. jenkins 配置(添加 artifactory 账户信息)
 
jfrog artifactory  jenkins pipeline 集成
 
3.  jenkins  pipeline 配置(实例使用github 实例)
 
   jenkinsfile 内容如下:
node("docker-64") {
    def server = Artifactory.newServer url: "http://xxxxxx:8081/artifactory", credentialsId: 'jfrog-artifactory'
    def rtMaven = Artifactory.newMavenBuild()
    def buildInfo

    stage ('Clone') {
        git url: 'https://github.com/jfrogdev/project-examples.git'
    }

    stage ('Artifactory configuration') {
        rtMaven.tool = '64maven' // Tool name from Jenkins configuration
        rtMaven.deployer releaseRepo: 'aliyun', snapshotRepo: 'aliyun', server: server
        buildInfo = Artifactory.newBuildInfo()
    }

    stage ('Exec Maven') {
        rtMaven.run pom: 'maven-example/pom.xml', goals: 'clean install', buildInfo: buildInfo
    }

    stage ('Publish build info') {
        server.publishBuildInfo buildInfo
    }
}
4. jenkins 构建效果
jfrog artifactory  jenkins pipeline 集成
 
 
5. artifactory 效果
jfrog artifactory  jenkins pipeline 集成
 
jfrog artifactory  jenkins pipeline 集成
 
jfrog artifactory  jenkins pipeline 集成
 
jfrog artifactory  jenkins pipeline 集成
 
 
6. 总结
总的来说还是比较好用的,结合jenkins pipeline 可能方便的进行信息的查看,同时jfrog artifactory 的功能也是比较强大的,可以方便我们进行历史构建信息的查询
7. 参考资料
https://wiki.jenkins.io/display/JENKINS/Artifactory+Plugin
http://www.jfrogchina.com/open-source
 
 
 
 

相关文章:

  • 2021-09-18
  • 2021-08-29
  • 2021-10-18
  • 2022-12-23
  • 2021-08-27
  • 2021-12-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-02
  • 2021-06-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
相关资源
相似解决方案