I am using aws code build for java maven projects. What I observered, for each build trigger, it is downloading dependencies from maven remote repository instead its local. So It is consuming lots of time. Is there any way to speed it up ?
Yes, there is a way to cache Maven dependencies in an S3 bucket, which might be reused for the next builds.
When you create the CodeBuild project, in the BuildSpec
section, you have to specify the location where the Maven dependencies are downloaded:
And you also may want to create an S3 bucket and provide it as the cache location in the Artifacts
section:
For full description on how to create a Maven pipeline with caching, see the AWS support page: source