4

Maven Micro-Tip: Get sources and Javadocs

When you're using Maven in an IDE you often find the need for your IDE to resolve source code and Javadocs for your library dependencies. There's an easy way to accomplish that goal.

mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc

The first command will attempt to download source code for each of the dependencies in your pom file.

The second command will attempt to download the Javadocs.

Maven is at the mercy of the library packagers here. So some of them won't have source code packaged and many of them won't have Javadocs.

I want to get all javadoc and sources in Gradle. For this I have got the command

   downloadSources=true
   downloadJavadoc=true

But it is not downloading sources of all dependendent jars. Could you please help me : What will be the gradle command?

I have got some links which are related to Maven. But I don't get anything in Gradle.

Related links for Maven:

  1. Source and Javadoc jar generation
  2. Maven – Always download sources and javadocs

I have also follow this link for gradle. But it is not downloading dependent sources and javadocs. So please suggest me.

Anykind of help will be highly appreciated.

Community
  • 1
  • 1
SkyWalker
  • 28,384
  • 14
  • 74
  • 132
  • Are you behind a proxy? if yes try this System.setProperty('http.proxyHost','yourproxyurl') System.setProperty('http.proxyPort', '80') – Suman g May 26 '16 at 10:02
  • @Sumang There is no proxy – SkyWalker May 26 '16 at 10:04
  • As already stated in the docs you mentioned. Some artifacts don't have source or javadoc or nothing....What is your problem? – khmarbaise May 26 '16 at 10:43
  • @khmarbaise I want to get dependent jar files with their source file. But getting only jars. No javadocs or sources. Would you please tell me how can i get javadocs or sources of dependent jars. Thanks – SkyWalker May 26 '16 at 10:47
  • Some artifacts in central don't have javadoc nor source code. So you can't change that. – khmarbaise May 26 '16 at 11:00
  • But is it possible to get which have javadoc and source code? @khmarbaise – SkyWalker May 26 '16 at 11:04

0 Answers0