Piotr Gabryanczyk’s Blog

Java, Refactoring, AOP, Spring, DDD, TDD, etc.

  • Blogroll

    • I have joined Anti-IF Campaign

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!

Advertisements

4 Responses to “How to download JavaDocs or sources in Maven 2?”

  1. 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.

  2. Richard Roda said

    To combine the above and do it in one mvn invocation (useful for IDEs that allow custom maven targets or custom commands):

    mvn dependency:sources dependency:resolve -Dclassifier=javadoc

  3. I have seen a great deal of useful issues on your web-site about desktops. However, I have got the viewpoint that notebook computers are still more or less not powerful more than enough to be a option if you usually do projects that require many power, for instance video editing and enhancing. But for website surfing, word processing, and most other common computer functions they are just fine, provided you can’t mind the little screen size. Many thanks for sharing your notions.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: