[英]Is there a way to get Maven to install javadocs for all dependencies to my local repo?
By running mvn dependency:sources
I can force maven to resolve all dependencies in my project, download the sources, and install them into my local repo. 通过运行mvn dependency:sources
我可以强制maven解决项目中的所有依赖关系,下载源代码,并将其安装到本地仓库中。
Is there something that does the same thing with my dependencies' JavaDocs? 是否有一些东西与我的依赖项的JavaDocs相同? Ie grab them from upstream repos and install them into my local repo. 即从上游仓库中获取它们并将它们安装到我的本地仓库中。
There is a way to do it with the eclipse:eclipse
mojo using the downloadJavadocs
parameter. 有一种方法可以通过使用downloadJavadocs
参数使用eclipse:eclipse
mojo来完成。
mvn eclipse:eclipse -DdownloadJavadocs
And if you don't use eclipse, just do 如果您不使用日食,那就做
mvn eclipse:clean
afterwards. 然后。
It's a hack, I know, but it works. 我知道这是一个hack,但是可以用。
Actually, dependency:sources
pretends to be configurable through the classifier
and type
parameters, so for a moment I thought you could do this: 实际上, dependency:sources
伪装为可通过classifier
和type
参数进行配置的,因此有一会儿我认为您可以这样做:
mvn dependency:sources -Dclassifier=javadoc -Dtype=jar
but I tried it and it didn't work. 但是我尝试了一下,但是没有用。 Then I checked the source code and found this: 然后我检查了源代码,发现了这一点:
private static final String SOURCE_TYPE = "java-source";
private static final String SOURCE_CLASSIFIER = "sources";
// ...
public void execute()
throws MojoExecutionException
{
// parameters are overwritten with constant values
this.classifier = SOURCE_CLASSIFIER;
this.type = SOURCE_TYPE;
I have now submitted a Bug concerning this. 我现在提交了一个与此有关的错误 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.