Monday, July 7, 2014

Maven Tip: Get sources and Javadocs of jars

When we are using Maven in an IDE we often find/feel the need of IDE to resolve source code and Javadocs for the library dependencies. There’s an easy way to accomplish that goal which maven provides us.

# 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.
Only problem here is that some of them won’t have source code packaged and so they won’t have Javadocs.