How do I create a jar distributable for javadocs?

后端 未结 2 501
攒了一身酷
攒了一身酷 2020-12-28 18:21

I\'ve created an API that I release as a JAR file. It\'s proprietary so I had to strip the source files out of it.

I currently include a separate /doc folder which

相关标签:
2条回答
  • 2020-12-28 18:42

    It seems it is enough to package the doc folder containing the eclipse generated documentation as a jar file. Then if you want to use that jar as javadocs of the actual jar containing the compiled .class files, you assign the javadoc jar with the "Javadoc in archive" in Eclipse and set the Path within archive as doc. It seems Eclipse looks for index.html and package-list entries in the doc folder.

    Setting Javadoc location in Eclipse

    Also using maven-javadoc-plugin may an easy way to do this. See the link below:

    http://www.avajava.com/tutorials/lessons/how-do-i-generate-and-deploy-a-javadoc-jar-file-for-my-project.html

    0 讨论(0)
  • 2020-12-28 19:08

    If your end goal is just for the future developers to be able to view your javadoc instructions when they are using your classes or methods, in Eclipse you can have option to export java source files when you export your jar library as shown in the image below:

    enter image description here

    This also allows developers to step in and view your codes while debugging.

    0 讨论(0)
提交回复
热议问题