AWS CodeBuild + CodePipeline: "No matching artifact paths found"

Buildspec artifacts are information about where CodeBuild can find the build output and how CodeBuild prepares it for uploading to the Amazon S3 output bucket.

For the error "No matching artifact paths found" Couple of things to check:

  1. Artifacts file(s) specified on buildspec.yml file has correct path and file name.

artifacts: files: -'FileNameWithPath'

  1. If you are using .gitignore file, make sure file(s) specified on Artifacts section is not included in .gitignore file.

Hope this helps.


In my case I received this error because I had changed directory in my build stage (the java project I am building is in a subdirectory) and did not change back to the root. Adding cd ..at the end of the build stage did the trick.


The artifacts should refer to files downloaded from your Source action or generated as part of the Build action in CodePipeline. For example, this is from a buildspec.yml I wrote:

artifacts:
  files:
    - appspec.yml
    - target/SampleMavenTomcatApp.war
    - scripts/*

When I see that you used MyApp in your artifacts section, it makes me think you're referring to the OutputArtifacts of the Source action of CodePipeline. Instead, you need to refer to the files it downloads and stores there (i.e. S3) and/or it generates and stores there.

You can find a sample of a CloudFormation template that uses CodePipeline, CodeBuild, CodeDeploy, and CodeCommit here: https://github.com/stelligent/aws-codedeploy-sample-tomcat/blob/master/codebuild-cpl-cd-cc.json The buildspec.yml is in the same forked repo.


I had the similar issue, and the solution to fix the problem was "packaging directories and files inside the archive with no further root folder creation".

https://docs.aws.amazon.com/codebuild/latest/userguide/sample-war-hw.html