java - Javadoc 的图像文件放在哪里?

标签 java image javadoc

我知道我可以在javadoc中使用IMG标签。但是图像文件放在哪里呢?如果我将它们与 java 文件放在一起,它们将在编译过程中转到 JAR 文件或 class 文件夹,这不是必需的。

如何获得只与javadoc相关而不与代码资源相关的图像文件?

最佳答案

Javadoc tool documentation 中所述,在“其他未处理的文件”部分:

To include unprocessed files, put them in a directory called doc-files which can be a subdirectory of any package directory that contains source files. You can have one such subdirectory for each package. You might include images, example code, source files, .class files, applets and HTML files. For example, if you want to include the image of a button button.gif in the java.awt.Button class documentation, you place that file in the /home/user/src/java/awt/doc-files/ directory. Notice the doc-files directory should not be located at /home/user/src/java/doc-files because java is not a package -- that is, it does not directly contain any source files.

这意味着图像文件必须作为源目录结构的一部分提供。这意味着您的构建过程应该设计为避免将这些文件复制到类目录结构中。原始 javac 工具不会执行复制,您必须配置 IDE 或构建脚本(maven、ant、gradle 等)以在编译或 jar 步骤中排除这些文件。

关于java - Javadoc 的图像文件放在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26084777/

相关文章:

objective-c - 如何通过 CodeSense 在 Xcode 中显示文档?

带有 Gradle : show also private members 的 Javadoc

java - Spring 和 Guice 一起,或者只是 Spring

ios - 如何获取流字节并转换回图像 - IOS

java - ImageIcon 加载速度越来越慢

python - 如何使用 Python OpenCV 将灰度图像转换为热图图像

java - 如何在Eclipse中查看Java提供的类

java - System.currentTimeMillis() 的减法

java - C <> Java多平台通信

java - 使用前缀键删除行范围