Skip to content
Sharp

Build Tools · interview question

In a Maven project, where do you declare a dependency for a new library you want to use?

Multiple choiceEasychapter-10-curatedpremiumbuild-toolsdependency-management
Choose one answer
Answer and explanation

Correct answer

D. In the pom.xml file under the <dependencies> section

Why

Dependencies in a Maven project are declared in the pom.xml file under the <dependencies> section. This allows Maven to manage library versions and transitive dependencies automatically.

Test yourself on Build Tools

A free test with instant, explained results. No account needed.

Start free test
All Build Tools questions →