Courseiva
Question 423 of 724
DeploymenteasyMultiple ChoiceObjective-mapped

DVA-C02 Deployment Practice Question

A company is using AWS CodeBuild to compile a Java application. The build takes a long time because Maven dependencies are downloaded each time. How can the developer reduce build time?

⚠ Common exam trap

Candidates often confuse CodeBuild's cache with EC2-based solutions (like custom AMIs) or assume that increasing compute resources solves all performance issues, when the actual bottleneck is network latency for repeated downloads.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Configure a cache in Amazon S3 for the Maven repository.

Configuring an Amazon S3 cache for the Maven repository allows CodeBuild to reuse previously downloaded dependencies across builds, eliminating the need to re-download them each time. This significantly reduces build time by leveraging the local cache stored in S3, which is a best practice for dependency-heavy builds like Java applications with Maven.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use a higher compute type for the build project.

    Why it's wrong here

    While a higher compute type (e.g., larger CPU and memory) can accelerate the compilation and execution phases of a build, it does not significantly reduce the time spent on network-bound operations like downloading external dependencies. For Java applications, dependency resolution from Maven repositories often consumes a substantial portion of the overall build duration, and this specific bottleneck is not primarily addressed by increased processing power alone.

  • Use a custom AMI with pre-installed dependencies.

    Why it's wrong here

    AWS CodeBuild environments are instantiated from Docker images, not Amazon Machine Images (AMIs), which are primarily used for EC2 instances. While a custom Docker image can indeed be pre-configured with necessary tools and dependencies to speed up builds, the proposed solution of using a custom AMI is fundamentally incompatible with CodeBuild's underlying container-based architecture. Therefore, this approach cannot be implemented as described for CodeBuild projects.

  • Increase the timeout value for the build.

    Why it's wrong here

    Increasing the build timeout value in CodeBuild only extends the maximum duration the service will wait for a build to complete before marking it as failed. This configuration prevents builds from timing out prematurely but does not introduce any performance optimizations or mechanisms to actively reduce the actual time taken for the build process itself. The build will still execute all its steps and consume the same amount of time to finish successfully.

  • Configure a cache in Amazon S3 for the Maven repository.

    Why this is correct

    For Java applications, a significant portion of build time is often consumed by downloading project dependencies from remote Maven repositories. Configuring a CodeBuild cache to store the local Maven repository (~/.m2 directory) in an Amazon S3 bucket allows these dependencies to be persisted and reused across subsequent builds. This dramatically reduces build duration by eliminating redundant network transfers and dependency resolution steps, as CodeBuild can efficiently restore the cache before the build starts, making it highly effective for improving build performance.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.