Junior — Middle
How does Maven manage and define dependencies for the project build process?
sobes.tech AI
Answer from AI
Maven manages dependencies through the pom.xml file, where the coordinates of dependencies (groupId, artifactId, version) are specified. During the build process, Maven automatically downloads the necessary libraries from the central repository or other specified repositories and includes them in the project.
Example of a dependency in pom.xml:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.20</version>
</dependency>
Maven also manages transitive dependencies — if a library depends on others, they will also be downloaded automatically.