可以分别使用downloadSources和downloadJavadocs将具有源和 javadocs 部署的工件附加到 IDEA 库。以下示例显示了如何在命令行中执行此操作:
mvn idea:idea -DdownloadSources=true -DdownloadJavadocs=true
或者,如果您更喜欢将配置放在 pom.xml 中:
<project> [...] <build> [...] <plugins> [...] <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-idea-plugin</artifactId> <version>2.2.1</version> <configuration> <downloadSources>true</downloadSources> <downloadJavadocs>true</downloadJavadocs> </configuration> </plugin> [...] </plugins> [...] </build> [...] </project>