Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why maven settings.xml file is not there?

I installed maven plugin for eclipse and was able to use it only in eclipse. I want to be able to run maven commands from terminal so installed maven as explained in the below link:

http://www.mkyong.com/maven/how-to-install-maven-in-ubuntu/

My questions are

  1. I could not find settings.xml in this path /home/raki/.m2/ -- What should I do for this?
  2. Does the maven installed in the above step affects the maven installed in eclipse? These two mavens work independently or how is that?
like image 593
javanoob Avatar asked Mar 15 '11 06:03

javanoob


People also ask

Where is my Maven settings XML file?

The Maven settings file, settings. xml , is usually kept in the . m2 directory inside your home directory.


2 Answers

settings.xml is not required (and thus not autocreated in ~/.m2 folder) unless you want to change the default settings.

Standalone maven and the maven in eclipse will use the same local repository (~/.m2 folder). This means if some artifacts/dependencies are downloaded by standalone maven, it will not be again downloaded by maven in eclipse.

Based on the version of Eclipse that you use, you may have different maven version in eclipse compared to the standalone. It should not matter in most cases.

like image 119
Raghuram Avatar answered Oct 23 '22 10:10

Raghuram


Installation of Maven doesn't create the settings.xml file. You have to create it on your own. Just put it in your .m2 directory where you expected it, see http://maven.apache.org/settings.html for reference. The m2eclipse plugin will use the same settings file as the command line.

like image 24
WhiteFang34 Avatar answered Oct 23 '22 09:10

WhiteFang34