You are on page 1of 2

Maven's 

pom.xml helps to download all jar files


at .m2/repository location. These jars can be
used for different projects. You need not to
manually download. But for the very first time you
need internet connection to download all jar files.
In pom.xml we have to set dependencies like
given below or whatever version of jars you want
to download. If later point in time you want to
change the version ( in following case $
{spring.version} then you have to change only
one place and everywhere get reflected.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
If you don't use pom.xml then while transferring
project you will have to transfer all jar files over the
network many times.
Maven give re-usability of jar files in multiple
project. You need not to have deep copy of all jar
files in WEB-INF/lib folder.

In very first attempt, any project will download all


jar files from internet and will store all those jar
files at .m2/repository. Second time in another
project, when you try to use other pom.xml file
then maven will try to find jars at local (your
computer) .m2/repository whatever
dependencies defined in your new
project's pom.xml if those files are there
in .m2/repository then maven will not try to
connect to internet to download (because
everything is downloaded at .m2/repository).
If pom.xml file finds new entry then it will connect
to internet and then download at .m2/repository

You might also like