Problem Statement
What is the purpose of artifact repositories like Nexus or Artifactory?
Explanation
Artifact repositories (Nexus, Artifactory, AWS CodeArtifact) centrally store and manage build artifacts (JARs, WARs, npm packages, Docker images) and dependencies. They serve as proxy for external repositories (Maven Central, npm registry) caching dependencies locally for faster builds and reliability when external sources are unavailable.
Key features include version management (store multiple versions), access control (who can publish/download), proxy caching (cache external dependencies), promotion workflows (move artifacts between repositories like snapshot to release), metadata management, and audit trails. Repositories support multiple formats: Maven, npm, PyPI, Docker, NuGet, and more.
CI/CD integration: build pipeline publishes artifacts to repository after successful build, deployment pipeline pulls artifacts from repository for deployment. Example Maven publish:
```xml
<distributionManagement>
<repository>
<id>releases</id>
<url>https://nexus.example.com/repository/maven-releases/</url>
</repository>
</distributionManagement>
```
Benefits include centralized artifact storage, build reproducibility, dependency caching, reduced external dependency failures, and artifact lifecycle management. Understanding artifact repositories is essential for enterprise CI/CD.
