Sometimes you may want to use Javadoc feature of your eclipse IDE so that you may be able to refer the source code and javadoc while using some API.
Following maven commands come in handy for these purposes:
mvn dependency:sources mvn dependency:resolve -Dclassifier=javadoc
First command attempts to download *-source.jar files for the dependencies listed in your pom.xml and second command downloads all the *-javadoc.jar
There is no guarantee that you will be getting sources and javadocs for all the jars. It really depends on whether the publisher of API published them to maven repo or not!
If you are not convinced to run above commands then you may configure this in your pom.xml as below
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <configuration> <downloadSources>true</downloadSources> <downloadJavadocs>true</downloadJavadocs> </configuration> </plugin> </plugins> </build>
also refer below link in order to generate source and javadoc jars for your project build.