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.
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.
- step:
name: Build
script: [ mvn package ]
artifacts:
paths:
- target/*.jarConfirm the output location
- Add a temporary
ls -Rto see where the build wrote files. - Update the glob to match that path and extension.
- 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
lswhile debugging. - Keep build output inside the clone so it can be captured.