Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a maven settings.xml file and how it is different from pom.xml

I am working on build a Android Maven project, and learning how to set up and take advantages of maven in android application development.

While I am reading some documentation (http://books.sonatype.com/mvnref-book/reference/android-dev-sect-config.html) it mentioned we could config maven plug-in in either settings.xml file, or put configuration into the pom.xml file.

I am a little confused about the usage of the two files. Do I need to have settings.xml in the maven project. How Settings.xml different from pom.xml?

Thank you, Allan

like image 421
Allan Jiang Avatar asked Jan 13 '23 01:01

Allan Jiang


1 Answers

settings.xml is your user preferences. It lives in your main Maven directory (usually $HOME/.m2) and holds your own settings, like listings for non-public repositories, usernames, and other personalized configuration.

pom.xml is the control file for each Maven project or module. It tells Maven which dependencies the project needs, what processing to apply to build it, and how to package it when it's ready. The POM is part of the project itself, and so information that's necessary to build the project (such as listing which plug-ins to use when building) should go there.

like image 146
chrylis -cautiouslyoptimistic- Avatar answered Jan 25 '23 09:01

chrylis -cautiouslyoptimistic-