Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include javadoc of scala code when distributing library Jars?

This question is related to calling scala code from java code.

When I include some scala library (in jar format), the return types are often of type scala.collection and other Scala types.

When developing in Java (in Netbeans) using the scala libraries, I get the following "error" when trying to view documentation for the Scala types.

Javadoc not found. Either Javadoc documentation for this item does not
exist or you have not added specified Javadoc in the Java Platform Manager
or the Library Manager.

what is the best way to include javadocs (of my code and the scala-library) in the distributed jars?

like image 298
Jus12 Avatar asked Jun 07 '11 07:06

Jus12


1 Answers

If you use maven, putting a dependency on Scala should instruct the plugin to pull the javadocs (and source for the matter) from the repository. If you're not using maven for dependency management.... Well, you should start now.

BTW, exposing Scala types for Java is not a good practice. You should wrap your Scala code into standard Java. It will greatly enhance the maintainability of the code since the developers using your jars won't have to twist their heads translating Java to Scala types.

like image 113
Cloves Almeida Avatar answered Sep 27 '22 02:09

Cloves Almeida