<p>I am using Maven (and the Maven Eclipse Integration) to manage the dependencies for my Java projects in Eclipse. The automatic download feature for JAR files from the Maven repositories is a real time saver. Unfortunately, it does not include API documentation and source code.</p>

<p>How can I set up Maven to automatically also get the source and javadoc attachments and register them properly with Eclipse?</p>

```
```
mvn eclipse:eclipse -DdownloadSources=true
```
```
or
```
```
mvn eclipse:eclipse -DdownloadJavadocs=true
```
```
or you can add both flags, as Spencer K points out.
Additionally, the
```
=true
```
portion is not required, so you can use
```
```
mvn eclipse:eclipse -DdownloadSources -DdownloadJavadocs
```
```