Get source JARs and Javadoc from Maven repository

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.


Option 1

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!

Option 2

If you are not convinced to run above commands then you may configure this in your pom.xml as below


also refer below link in order to generate source and javadoc jars for your project build.


  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: