Artifact Repository: Your CI/CD's Private Library
An artifact repository is your CI/CD's private library for build outputs like packages and images. CI pipelines publish artifacts here, and deployment scripts pull from it.
Why it exists
Building from source code every single time is slow, inconsistent, and doesn't scale. You need a reliable, central place to store the results of a build—the artifacts—so they can be shared, tested, and deployed predictably without being rebuilt.
The mental model
Think of an artifact repository as a private, version-controlled library for your compiled code. Instead of checking out books (source code) from a public library (GitHub), you're publishing your own finished books (artifacts) to a private shelf (the repository) where others in your organization can reliably find and use them. It stores the "what" (the binary) and the "how" (metadata like version, build number, and dependencies).
How it works
A CI server, like Jenkins or GitHub Actions, runs a build. On success, it packages the output, such as a .jar file or a Docker image. It then uses a client tool like Maven, npm, or the Docker CLI to "push" this package, along with metadata like its version, to the artifact repository (e.g., Nexus, Artifactory). Other projects or deployment scripts then configure their package managers to pull from this repository, treating it as a trusted source for dependencies.
When to use it
Use an artifact repository to store and share any binary output from a build process that needs to be consumed by other teams, systems, or environments. This is essential for managing dependencies between microservices, sharing internal libraries, and ensuring deployments use a consistent, tested version of the software. It also acts as a cache for public dependencies, improving build speed and reliability.
When not to use it
Do not use it for source code; that's what version control systems like Git are for. It is also not a general-purpose file storage system like Amazon S3. Its power comes from understanding package formats and managing versions and metadata, so using it for random, unstructured files is overkill and misses the point.
One canonical example
A Java project's CI pipeline successfully builds and tests a new version of a shared library, common-utils-1.2.3.jar. The pipeline then uses Maven to deploy this JAR file to an Artifactory instance. Another team's project, which depends on common-utils, can now update its configuration to use version 1.2.3, and their next build will automatically download the new JAR from Artifactory.
Interview question
Which scenario best demonstrates the appropriate use of an artifact repository?
- a.Publishing a newly built Java .jar file to be consumed by other internal projects.Correct
- b.Storing the raw source code of a project for version control.
- c.Archiving unstructured log files from a production server for future analysis.
- d.Serving static website assets like HTML, CSS, and JavaScript files to end-users.
Why? this is the answer
An artifact repository is designed to store and share binary outputs like compiled code (.jar files) from a build process for consumption by other systems or teams. Storing source code is for version control systems, while archiving unstructured logs or serving static assets are roles for general file storage or web servers, not artifact repositories.
Just read this? Test yourself on what you have been reading.
Read the original → en.wikipedia.org
- #ci/cd
- #devops
- #builds
- #dependencies
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on ci/cd — each one lists the topics its interview covers.
See open roles