0

How can I add the pom.xml (maven) version number to the Artifactory repository path in the pipeline.

resource_types:
  - name: artifactory
    type: docker-image
    source:
      repository: pivotalservices/artifactory-resource

resources:
  - name: artifactory-racer-webapi-app
    type: artifactory
    check_every: 167h
    source:
      endpoint: https://artifactory.xxxx/artifactory
      repository: "/xxx-libs-releases/xxxx-webapi-app/<version>"
      regex: xxx-webapi-app-(?<version>.*).jar
      username: ((username))

Same idea as I did with the regex.

danilopopeye
  • 9,610
  • 1
  • 23
  • 31
angus
  • 3,210
  • 10
  • 41
  • 71
  • Do you want to extract the version of the POM to command line? – J Fabian Meier Aug 20 '21 at 16:39
  • Not exactly, I am using Concourse to deploy the artifact. I was assuming that the version number of the pom will be part of the repo path but apparently its not. I want to add the version number to the pipeline.yml so the repo path will look like "/xxx-libs-releases/xxxx-webapi-ap/0.0.1" – angus Aug 20 '21 at 16:55
  • What do you mean by "repo path"? You have a base path for the repo, a repository and then you get a path that consists of groupId, artifactId and version. – J Fabian Meier Aug 20 '21 at 17:38
  • I mean that the Artifact will be deploy under a directory with the name of the version number that was defined in the pom. For example if version in the pom is 0.0.2 then the jar will be deploy to this path "/xxx-libs-releases/xxxx-webapi-app/0.0.2". – angus Aug 20 '21 at 17:53
  • If this is a Maven project, then the path inside the repository is fully determined by the groupId, artifactId and version. You cannot influence the path inside the Maven repository. – J Fabian Meier Aug 20 '21 at 18:15
  • Hi Fabian, Yes I agree and this is what I am expect to see eventually in Jfrog. But for some reason the path will be created without the version number. I have no idea what is wrong. I have tried several options in the repo -> "repository: "/xxx-libs-releases/xxxx-webapi-app/???? NO VERSION DIRECTORY" – angus Aug 20 '21 at 18:28

0 Answers0