Use this when keeping build outputs in Jenkins.
Artifacts · Jenkins
Jenkins artifacts are files kept from a build, saved with archiveArtifacts, such as packages or reports. Store long-term artifacts in a repository like Nexus or Artifactory instead.
1. Artefacts are build outputs.
2. Archive or publish to repository.
3. Retention to save disk.
4. Fingerprints for traceability.
5. No secrets.
build → artefacts → repository
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
Run a controlled build that produces known files and checksums, archive using the production pattern, and confirm expected files are present while excluded files are absent. Test the empty-artifact behavior and retention expectations. Download or fetch the archived artifact by build ID and compare hash/content, then trace the build to its source revision.
Step 2 Common mistakes Narrow the fault
- Artefacts not archived or fingerprinted.
Step 3 Where it fails Narrow the fault
Separate build generation, workspace paths/glob expansion, Jenkins archive step, controller/storage retention and downstream consumer retrieval. Missing artifacts can come from a build that never created them, a bad pattern, retention cleanup or storage failure. Do not set allowEmptyArchive merely to turn a missing required deliverable green; show whether the artifact is optional first.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- archiveArtifacts keeps files from a build.
- Use an artifact repository for long-term storage.
- Set retention to limit disk use.
- archiveArtifacts patterns — outputs
- Artefact repository (Nexus/Artifactory) — storage
- Build retention (buildDiscarder) — disk usage
ReferenceWhy it matters1 section · depth on demand
In depth
Jenkins artifacts are files archived from a build — reports, packages, rendered configurations, logs — kept with the build record for download or for later jobs. Fingerprinting tracks which builds produced and used each file.
post {
always {
archiveArtifacts artifacts: 'build/**/*.cfg, reports/*.html', fingerprint: true, allowEmptyArchive: true
junit 'reports/junit.xml'
}
}
Artifacts are stored on the controller by default and fill its disk quickly; use buildDiscarder to limit retention, and an artifact manager plugin (S3, Azure) or a repository manager (Nexus, Artifactory) for large or long-lived artifacts. Copy artifacts between jobs with the Copy Artifact plugin or stash/unstash within one pipeline.
ReferenceImportant terms & boundaries1 section · depth on demand
Mechanics
Jenkins artifacts are files retained from a build for later download or consumption. The archive pattern is evaluated relative to the workspace, build retention controls availability, and optional fingerprinting helps track artifact usage. Artifacts are not the same as short-lived stashes, caches or external repository packages. A successful build can archive the wrong files if glob patterns or workspace paths are incorrect.
ReferenceConfiguration & state1 section · depth on demand
Lifecycle
Define which outputs are build artifacts, how long Jenkins retains them, whether an external artifact repository becomes authoritative, and whether fingerprints/checksums are required. Keep archive patterns reviewed with build layout changes and avoid retaining secrets or huge transient directories. Promotion should refer to immutable build/artifact identity rather than rebuilding from the same branch.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Jenkins > Artifacts. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.jenkins.io/doc/pipeline/tour/tests-and-artifacts/ · confidence 94%Quick lookup tables
Jenkins → Artifacts · operational reference
Context-specific ownership, verification, output and failure-boundary lookup for Jenkins → Artifacts.
| Layer | Jenkins → Artifacts operational reference |
|---|---|
| Runtime/ownership | Jenkins Pipeline artifacts · identify controller/parser, durable intent, identity and target ownership before mutation |
| Persistent intent | Versioned definition/configuration with explicit dependencies, scope and credential boundary |
| Verification | Run a fixture build with archiveArtifacts artifacts: 'build/**', fingerprint: true; verify archived files, checksums/fingerprint and build provenance. |
| Expected interpretation | The intended files are archived from the expected workspace/build, empty/unexpected patterns fail as policy requires, and consumers can trace artifacts back to the exact build and source revision. |
| Recovery boundary | Preserve correlation IDs + pre-state, repair first failing boundary, then verify the target independently |
Deep reference
Healthy vs suspicious evidence
Output interpretation
Capture Jenkins job/build ID, source revision, workspace-relative artifact path, size, checksum/fingerprint, archive result and retention/promotion destination. A log line saying “archived” is weaker than enumerating the actual retained files. Distinguish archived artifacts from stashes, test reports and external repository uploads.