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 file开发者_开发技巧s stored?
Note: this is my first day using Maven so my understanding of Download Sources may be way off.
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>
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>
By default, Maven should download dependencies sources and JavaDocs to its local repository. If you don't know where is your local Maven repository, check Maven settings.xml file You can read more here
精彩评论