Attach Sources and/or Javadocs to Library Dependencies

Artifacts with sources and javadocs deployed can be attached to IDEA libraries using downloadSources and downloadJavadocs respectively. The following example shows how to do this in the command-line:

mvn idea:idea -DdownloadSources=true -DdownloadJavadocs=true

or if you prefer putting the configuration in your 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>