spring 如何使用 Maven Eclipse 插件从其他存储库下载源代码和 javadoc 工件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17086272/
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
How to download sources and javadoc artifacts with Maven Eclipse plugin from other repository?
提问by misco
I have spring framework dependencies in my Maven project. I want to attach the Javadoc for spring framework dependencies.
我的 Maven 项目中有 spring 框架依赖项。我想附上 Spring 框架依赖项的 Javadoc。
I added to pom.xmlfollowing lines
我添加到pom.xml以下行
<repositories>
<repository>
<id>springsource-repo</id>
<name>SpringSource Repository</name>
<url>http://repo.springsource.org/release</url>
</repository>
</repositories>
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
</plugins>
</build>
I have installed m2eclipse and I also checked option Download Artifact Sources/Javadocin settings.
我已经安装了 m2eclipse 并且我还在Download Artifact Sources/Javadoc设置中选中了选项。
When I run mvn eclipse:eclipse, it doesn't show any warnings. But javadoc .jarfiles aren't downloaded.
当我运行时mvn eclipse:eclipse,它没有显示任何警告。但是.jar不会下载javadoc文件。
回答by khmarbaise
In Eclipse goto Windows->preferences->Mavenand there you check the box with download sourcesand may be download javadocas well. That should do the trick.
在 Eclipse 中,转到Windows->preferences->Maven并在那里选中带有下载源的框,也可以下载 javadoc。这应该够了吧。
回答by Rohitdev
You can download from this location http://repo.spring.io/libs-release/org/springframework/spring/
你可以从这个位置下载http://repo.spring.io/libs-release/org/springframework/spring/
回答by David L.
With a Maven project, simply run in the command line:
对于 Maven 项目,只需在命令行中运行:
mvn dependency:sources
mvn 依赖:来源

