Maven's ability to automatically download a library's JavaDocs is very useful. However, sometimes it is desirable to view the javadocs in an external browser, and not just in IDEA's quick documentation window. Currently the javadoc contained in a jar (or zip) file cannot be viewed in an external browser. An error message similiar to the fllowing is deiplayed:
Cannot show "jar://C:/data/.m2/repository/junit/junit/4.4/junit-4.4-javadoc.jar!/org/junit/Assert.html#assertEquals(java.lang.Object, java.lang.Object)" in external browser.
There are two possible options to allow this ability
1. Firefox supports the
jar: protocol, but requires a secondary protocol specified after it:
Syntax: jar:file://< full path to filename.zip >!/
Example: jar:file:///home/user/Desktop/filename.zip!/
Also: jar:file:///home/user/Desktop/filename.zip!/dir/file1.html
So the URL
jar://C:/path/to/jar/api.jar!/org.foo/Bar.html would need to be altered to
jar:{color:red}file:{color}//C:/path/to/jar/api.jar!/org.foo/Bar.html This would of course limit this ability to FireFox (and any other browsers that support it). But it would likely be a relatively quick fix. (Note that the
jar protocol works for JAR and ZIP files)
2. When a user attempts to view JavaDocs from an archive in an External Browser, have IDEA extract those files so they can be viewed. Ideally, it would be nice to have the ability to set the auto-extract option to "never", "ask each time", and "always". It would also be nice to have the ability to set the directory where they are extracted (not each time, but a base directory in the IDE settings).
Of course, the most ideal solution would be to implement both options so that browsers that support the
jar protocol would use that, otherwise the files would be extracted. I'd think option 1 would be relatively easy to add, so that might be a good place to start with other abilities added later.
Issue was resolved