How to download sources and JavaDoc with maven in Eclipse

Posted on December 18, 2016

In this post, we will show you how to download sources and JavaDoc for dependencies of your maven project in Eclipse IDE.

Technologies used –

  • Spring Tool Suite (Version: 3.8.2.RELEASE) or Eclipse Mars.2 (4.5.2)
  • Maven 3.3.9
  • JavaSE 1.8

Let's begin step by step...

Step 1 - Create a Maven project

Go to New menu → Other..Maven → Maven Project and click on Next.

In New Maven Project wizard, click on Next.


Step 2 - Select Maven project archetype

Select archetype as maven-architype-quickstart and click on Next.


Step 3 - Add project information

In the next wizard, add project information as shown below and click on Finish.



Step 4 - Edit pom.xml file and update project

Open pom.xml file and write the following code in it.

<project xmlns="" xmlns:xsi=""






After changes in pom.xml update your project. To update maven project, right click on project → Maven Update Project...


Step 5 - Review project directory structure

Here is the final project structure.


Step 6 - Download source and JavaDoc

To download sources for dependencies of maven project, right click on project → Maven Download Sources.


Similarly to download JavaDoc for dependencies of maven project, right click on project → Maven Download JavaDoc.


Step 7 - View Source and JavaDoc

Double click on class file to view the source and javadoc as show below.