'jenkins, what does fingerprint artifacts means?

My understanding

As far as I understood artifacts up to now, is that it was used to know if my project refers to an unfinished build task's artifacts.

Problem

I tried reading more (on jenkins site too) but I'm not sure I understand so easily what they do now. I know that when I promote a build, I can fingerprint artifacts. What does it mean then?



Solution 1:[1]

  • Artifacts - anything produced during the build process.
  • Fingerprinting artifacts - recording the MD5 checksum of selected artifacts.

You can then use the MD5 checksum to track a particular artifact back to the build it came from.

Solution 2:[2]

Adding to @Slav answer, Fingerprinting help Jenkins in keeping track of which version of a file is used by which version of a dependency.

Quoting an example and how it works from Jenkins Page:

For example:

  • Suppose you have the TOP project that depends on the MIDDLE project, which in turn depends on the BOTTOM project.

  • You are working on the BOTTOM project. The TOP team reported that bottom.jar that they are using causes an Null Pointer Exception, which you (a member of the BOTTOM team) thought you fixed in BOTTOM #32.

  • Jenkins can tell you which MIDDLE builds and TOP builds are using (or not using) your bottom.jar #32.

How does it work?

The fingerprint of a file is simply a MD5 checksum. Jenkins maintains a database of md5sum, and for each md5sum, Jenkins records which builds of which projects used. This database is updated every time a build runs and files are fingerprinted.

To avoid the excessive disk usage, Jenkins does not store the actual file. Instead, it just stores md5sum and their usages. These files can be seen in

$JENKINS_HOME/fingerprints

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Slav
Solution 2 Arpit Aggarwal