简体   繁体   English

如何让 Maven 下载特定依赖项的源代码和 javadoc?

[英]How to make Maven to download source code and javadoc for specific dependencies?

I need for specific dependencies documentation, for some documentation and source code.我需要特定的依赖文档,一些文档和源代码。 What is the best way to tell maven to do that?告诉 Maven 这样做的最佳方法是什么?

Firstly, IntelliJ should automatically download sources for you although sometimes you may need to click on 'Download Source'.首先,IntelliJ 应该会自动为您下载源代码,尽管有时您可能需要单击“下载源代码”。 This actually uses Maven to fetch the source and javadoc.这实际上使用 Maven 来获取源代码和 javadoc。

If you want to do it with the Maven command line an example of a command that downloads javadoc for a specific artifact is:如果您想使用 Maven 命令行执行此操作,则下载特定工件的 javadoc 的命令示例是:

mvn dependency:sources -Dclassifier=javadoc -DincludeArtifactIds=<my-artifact>

If you need both the source and javadoc just remove the javadoc classifier.如果您同时需要源代码和 javadoc,只需删除 javadoc 分类器。

对于 javadoc,在依赖项中包含这个标签

<classifier>javadoc</classifier>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM