How do you get sources Jars from Maven Repository?

To get sources Jars and Java docs from Maven Repository you need to execute below Goals:

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

In case you have lot of dependencies, you can include/exclude source Jars by using below Maven command:

mvn dependency:sources -DincludeArtifactIds=guava

Author: Mahesh

Technical Lead with 10 plus years of experience in developing web applications using Java/J2EE and web technologies. Strong in design and integration problem solving skills. Ability to learn, unlearn and relearn with strong written and verbal communications.