How to download JavaDocs or sources in Maven 2?
Posted by Piotr Gabryanczyk on June 25, 2009
Problem
You want to download javadocs for your depenencies into local repository to be able to use them ie. in IntelliJ.
Solution
mvn dependency:resolve -Dclassifier=javadoc
mvn dependency:resolve -Dclassifier=sources
Enjoy!

Brian Fox said
There is also dependency:sources which is the same as resolve -Dclassifier=sources.
Honestly these are mostly super ceded these days by the IDE integration such as M2Eclipse. These were handy back in the days when the repos were unreliable and the only other way to do it was with eclipse:eclipse, but it would trash your project settings.
sander said
Brian, I honestly think it’s faster to download the sources/javadoc through commandline and put your maven installation in ‘offline’ modus in m2eclipse. I have bad experiences with the m2eclipse sources- and javadocdownloader.
Thanks for the commands, Piotr.