Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does Maven store the source and javadocs when downloaded via the Eclipse plugin

I'm using the Maven Eclipse plug-in to to add dependencies to my project. After setting a dependency, I right-clicked my project, selected Maven->Download Sources (and JavaDoc) but they were not automatically attached to the dependency's classes. Where are the source code and JavaDoc files stored?

Note: this is my first day using Maven so my understanding of Download Sources may be way off.

like image 989
Haphazard Avatar asked Dec 18 '10 20:12

Haphazard


2 Answers

if you don't have a <localRepository> entry under <settings> in your settings.xml, they will by default go in $HOME/.m2. To specify a different location, add (or uncomment) localRepository:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <localRepository>/path/to/local/repo</localRepository>
like image 28
amphibient Avatar answered Oct 05 '22 22:10

amphibient


When you install maven it's default installation directory is /usr/share/maven

Inside this directory you have mvn executable, configurations etc. The file you are looking for is /usr/share/maven/conf/settings.xml

In this you have following default configuration

  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ~/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->

So by default all dependencies will be downloaded to ~/.m2/repository. If you want to change this you can provide your path in

<localRepository>/path/to/local/repo</localRepository>
like image 178
Aniket Thakur Avatar answered Oct 05 '22 22:10

Aniket Thakur