Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse|Maven: Can't download source code of jar package?

There are plenty of similar questions in stackoverflow, like Get source JARs from Maven repository, Maven – Always download sources and javadocs, etc.

Follow the instructions suggested by those answers, Eclipse still can't download source code of jar package, but javadoc has been downloaded.

Does someone can tell me why? I fell quite confused.

like image 893
Tangoo Avatar asked Sep 02 '25 14:09

Tangoo


2 Answers

I believe that you are using an embedded version of maven.

There are two items you need to check:

  1. Check if the options in Eclipse are selected as screen bellow

enter image description here

The second approach is to select an external installation of maven.

Take a look in the screenshot bellow. I'm using an external installation of maven.

enter image description here

In the second approach maven will read the settings.xml of external installation.

like image 53
josivan Avatar answered Sep 05 '25 05:09

josivan


There are few ways you can do it

1. mvn eclipse:eclipse -DdownloadSources
2. mvn dependency:sources

3. or below in pom.xml

<properties>
  <downloadSources>true</downloadSources>
  <downloadJavadocs>true</downloadJavadocs>
</properties>
like image 25
Girdhar Singh Rathore Avatar answered Sep 05 '25 03:09

Girdhar Singh Rathore