简体   繁体   English

将Jar神器从Bamboo部署到Artifactory

[英]Deploy Jar Artifact from Bamboo to Artifactory

I have defined a plan in bamboo that package a remote repository to a Jar file (Maven project). 我用竹子定义了一个计划,该计划将远程存储库打包到Jar文件中(Maven项目)。 Basically this Jar is the first result I wanted to get from this plan. 基本上,这个Jar是我想从该计划中获得的第一个结果。 Now I would like to deploy this artifact to Artifactory, using the Artifactory Generic Deploy task. 现在,我想使用Artifactory Generic Deploy任务将该工件部署到Artifactory。 In this task, it has to be defined a Specs file specifying the pattern and target of this Jar. 在此任务中,必须定义一个Specs文件,以指定此Jar的模式和目标。

This is the Specs file I defined : 这是我定义的规格文件:

{
  "files": [
   {
    "pattern": "${bamboo.build.working.directory}/target/*jars",
    "target": "https://artifactory.mycompany.com:443/sandbox/"
   }
  ]
}

I would like to deploy this Jar file into the repository I defined above (sandbox). 我想将此Jar文件部署到我在上面定义的存储库(沙盒)中。 The plan runs well but I don't see anything in this repository after its execution. 该计划运行良好,但执行后在此存储库中看不到任何内容。

Is there something else to configure in this Specs file in order to obtain the behaviour I would like ? 为了获得我想要的行为,在此Specs文件中还需要配置其他东西吗? (basically push this artifact to a repository in Artifactory) (基本上将此工件推送到Artifactory中的存储库中)

Thanks! 谢谢!

The value of the "target" property in the File Spec should not include a URL. 文件规范中“ target”属性的值不应包含URL。 It should include the upload path in Artifactory, starting with the target repository. 它应该包括Artifactory中的上传路径,从目标存储库开始。

As for the "pattern" path, it starts from the current directory, which is the build plan's workspace, so if you'd like the "pattern" to pick up all the jar files in the "target" directory, the "pattern" value should be "target/*.jar". 至于“模式”路径,它从当前目录(即构建计划的工作空间)开始,因此,如果您希望“模式”拾取“目标”目录中的所有jar文件,则“模式”值应为“ target / *。jar”。

So if you'd like to deploy all the jar files inside "target" to a local repository named "sandbox", the the File Spec should be: 因此,如果要将“目标”中的所有jar文件部署到名为“沙盒”的本地存储库中,则文件规范应为:

{
  "files": [
   {
    "pattern": "target/*.jar",
    "target": "sandbox"
   }
  ]
}

Also make sure to select the Artifactory URL from the Generic Deploy tasks's UI. 另外,还要确保从“通用部署”任务的用户界面中选择Artifactory URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM