Skip to content
Latchkey

Bitbucket Artifact Path Did Not Match Any Files

A step declared artifacts: but the paths: glob matched no files when the step finished, so an empty artifact is stored and downstream steps receive nothing.

What this error means

The log warns the artifact path matched no files, and a later step cannot find the expected output. The build succeeded; the artifact glob simply pointed at the wrong place.

bitbucket-pipelines
Searching for files matching artifact path "build/*.jar"
No files were found to upload for the artifact.

Common causes

Glob targets the wrong directory or extension

The paths: pattern must match where the build actually wrote output. A wrong folder (build/ vs target/) or extension captures nothing.

Output produced after artifact collection scope

Artifacts are collected from the step's working directory at step end. Files written outside the clone, or cleaned up before the step finishes, are not captured.

How to fix it

Point the glob at the real output

Match artifacts: paths: to where the build writes files.

bitbucket-pipelines.yml
- step:
    name: Build
    script: [ mvn package ]
    artifacts:
      paths:
        - target/*.jar

Confirm the output location

  1. Add a temporary ls -R to see where the build wrote files.
  2. Update the glob to match that path and extension.
  3. Keep artifact output inside the build working directory.

How to prevent it

  • Match the artifacts paths: glob to the real output directory.
  • Verify artifact contents with a quick ls while debugging.
  • Keep build output inside the clone so it can be captured.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →