Build Tools · interview question
In a Gradle project, if a dependency is updated in a remote repository, how can you force your project to use this updated version?
Multiple choiceHardchapter-10-curatedpremiumbuild-toolsdependency-management
Answer and explanation
Correct answer
C. Use the 'refreshVersions' plugin or clear the Gradle cache
Why
Gradle caches dependencies to avoid unnecessary downloads. To force an update, you can use the 'refreshVersions' plugin or clear the Gradle cache. This ensures that the project retrieves the latest version from the remote repository.
Test yourself on Build Tools
A free test with instant, explained results. No account needed.
More Build Tools questions
- In a Maven project, where do you declare a dependency for a new library you want to use?
- Which Maven command would you use to ensure that the project is cleaned and rebuilt, including tests?
- When using Maven, which phase is responsible for verifying the quality of the code by running integration tests?
- In a Maven project, how are dependencies typically fetched?
- How does Maven resolve dependencies that are not present in the local repository?
- Which of the following is a primary benefit of using Gradle over Ant for building Java projects?