附加库源和 Javadocs

可以使用downloadSources将已部署源的工件附加到 Eclipse 库。可以使用downloadJavadocs附加 Javadocs库的源代码和 javadocs必须存在于存储库中,以便插件可以下载并附加它。

以下示例显示了如何在命令行中执行此操作:

mvn eclipse:eclipse -DdownloadSources=true  -DdownloadJavadocs=true

或在您的 pom.xml 中:

<project>
  [...]
  <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>
  [...]
</project>