Junior — Middle
How does dependency installation and project configuration occur in Maven?
sobes.tech AI
Answer from AI
In Maven, dependencies and project configuration are managed through the pom.xml (Project Object Model) file. This file describes:
- Dependencies: groups, artifacts, and versions of libraries needed for the project.
- Plugins: tools for building, testing, and packaging.
- Project settings: Java version, project information, repositories.
Example of a dependency in pom.xml:
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.20</version>
</dependency>
</dependencies>
When running the command mvn install, Maven downloads all specified dependencies from central repositories and builds the project according to the configuration.