通过 Eclipse 插件下载时,Maven 将源代码和 javadoc 存储在哪里
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4480009/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where does Maven store the source and javadocs when downloaded via the Eclipse plugin
提问by Haphazard
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?
我正在使用 Maven Eclipse 插件向我的项目添加依赖项。设置依赖项后,我右键单击我的项目,选择 Maven->下载源(和 JavaDoc),但它们没有自动附加到依赖项的类。源代码和 JavaDoc 文件存储在哪里?
Note: this is my first day using Maven so my understanding of Download Sources may be way off.
注意:这是我第一天使用 Maven,所以我对下载源的理解可能还很遥远。
回答by Aniket Thakur
When you install maven it's default installation directory is /usr/share/maven
当你安装 maven 时,它的默认安装目录是 /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
在此目录中,您有 mvn 可执行文件、配置等。您要查找的文件是 /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
因此,默认情况下,所有依赖项都将下载到~/.m2/repository
. 如果你想改变这一点,你可以提供你的路径
<localRepository>/path/to/local/repo</localRepository>
回答by amphibient
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:
如果你没有<localRepository>
在条目<settings>
中的settings.xml
,它们将会被默认进去$HOME/.m2
。要指定不同的位置,请添加(或取消注释)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 Lukasz
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.xmlfile You can read more here
默认情况下,Maven 应该将依赖源和 JavaDocs 下载到其本地存储库。如果您不知道本地 Maven 存储库在哪里,请查看 Maven settings.xml文件您可以在此处阅读更多信息