1

I am using Jenkins CI(single pipeline Job) to push different files to JFrog Artifactory.

For each and every build I am publishing the build info to Artifactory. But every build has same Module ID.

for example: In Artifactory Repository Browser select any artifact then go to Build tab, then it is showing all builds instead of respective artifact build information

So I would like to know how to modify the Artifact Module ID while publishing the artifact information to Artifactory

1 Answers1

2

The build information and Artifact storage are to different mechanisms. The build information is only associated with artifacts in the sense that you can define what artifacts are produced from a build and what artifacts are a dependency of a build. The module ID has no association with the build info. The module ID is defined by the repository layout where the Artifact is stored. See the jfrog documentation here: https://www.jfrog.com/confluence/display/RTF/Repository+Layouts

You cannot change the module ID. Artifactory assigns a module ID based on the repository layout. This means the path to the artifact matters for defining the module ID. For example the repository layout

[org]/[module]/[module]_[base_rev].[ext] will give module IDs to any artifact stored following that pattern as [org]:[module]:[base_rev].

Artifacts are associated to builds by both a build.name, build.number property on the artifact and publishing a build info from a .json file. The .json must include a section denoting what artifacts were produced from the build.

In general, it sounds like you need to ensure each artifact is being deployed to a unique path in artifactory with the build.name and build.number property being set. The other thing to look at is the file hash. it must match in the build info being published. So if the file hash is not different that means there is no change to the artifact from the previous build.

I don't know how much this will help, but there is a lot of nuances that go into getting the artifacts and builds to line up. You mentioned using Jenkins, have you looked into using the Jenkins Artifactory plugin. It should take care of a lot of this work for you, although we use Bamboo, so I am not as familiar with how it differs.

T.Haney
  • 41
  • 3
  • you mentioned Module ID is defined by the repository layout. Seems like it is not true. Becuase I am using Maven repository inside I have two different folders one is for Java artifacts another one is for general files. I am getting different module ID for each java artifacts but not for the general files in the same repository. – Ramakrishna Yelduti Oct 13 '17 at 05:49