I'm working first time with Maven project. Just created new Maven project in eclipse and in pom.xml I've added below configuration. Like Spring, log4j's jar version etc
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.LearnJavaSpring</groupId>
<artifactId>TalendJavaSpring</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<properties>
<spring.version>5.1.4.RELEASE</spring.version>
</properties>
</project>
The moment I save my pom.xml file, It automatically creates folder at C:\Users\trisha\.m2
location with respective jars in it, the one I've mentioned in pom.xml.
1) My doubt is, From where maven got these jars automatically in above folder location ? Does maven downloads the dependencies automatically ?
2) Is it correct to think in this way that, Maven parse the pom.xml
file when we save that and download all the dependencies or jars mentioned in pom.xml
file ?
3) What if I want maven to download jars from the different location from where Maven does ? Does maven automatically downloads the latest jars ?
4) Is that possible to change this default folder location C:\Users\trisha\.m2
to other location ? If yes, How..?