views:

31

answers:

2

I know I can use maven to pull the javadocs for an artifact (if they've been added), which should come through as a JAR (right?), which I can then unpack and browse. My problem is, I'm trying to figure out which of a series of artifacts have the particular package I'm hunting for. I could download a half-dozen javadoc packages, unpack all of them, then open the index files one at a time, but that sounds like it would be pretty unpleasant.

There must be a better way! I noticed that Nexus supports javadoc artifact browsing, but apparently only in the Pro version (which we do not have, and are unlikely to get any time soon). I'd prefer a GUI solution, though I'd settle for a command line answer, provided it's something along the lines of showmethedocs groupId:artifactId [version].

ETA: To clarify: I'm looking specifically to compare multiple versions of an artifact, or multiple different but similar artifacts ("foo:core" versus "foo:utils" versus "foo:extra" or something) when I'm not sure what artifact actually contains the package / class I need. Maybe there's a better way to do that, and I asked the wrong question? If I add each artifact as a Maven dependency and check the docs in Eclipse, that can work, but if there's 20 old versions of an artifact, and exactly one of them has the method I'm looking for, it could take a while.

+1  A: 

If you run

mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true

from the root of your project, it will download any sources & javadocs on the remote repository to your local repository. If you have m2eclipse, you can set that in the preferences to happen automatically in the background, and then drill down to the dependency you want, right click and then say 'open Javadoc'. See:

http://www.sonatype.com/people/2008/10/browsing-javadoc-for-dependencies-in-eclipse-m2eclipse/

shipmaster
This is pretty nice, though if I don't want to toggle between command line and GUI I can add each artifact as a dependency, right-click under the Maven Dependencies section, then select "Download Javadoc". Of course, I'd like to adding/removing them all, but it's better than nothing.
Coderer
A: 

Netbeans 6.9 can open maven project directly and has also 'Download Javadoc' feature. alt text

amra