您可以使用OmniFaces Vdldoc 从您的<cc:interface> 标签(或taglib.xml 文件中的文档)生成文档。
假设您的复合组件位于/META-INF/resources/myLib 文件夹中。然后,您将需要在 META-INF 文件夹中的 myLib.taglib.xml 文件,如下所示:
<facelet-taglib>
<description>Your description</description>
<namespace>http://example.com/myLib</namespace>
<short-name>my</short-name>
<composite-library-name>myLib</composite-library-name>
</facelet-taglib>
(有关更完整的示例,请查看this question)
您现在可以使用 Vdldoc 生成文档:
java -jar vdldoc-2.1.jar myLib.taglib.xml
更新:
如果您的项目使用 maven,现在有 vdldoc-maven-plugin 可以轻松地将其集成到您的构建中。基本上只需将其添加到您的pom.xml 的<reporting> 部分:
<reporting>
<plugins>
<plugin>
<groupId>com.github.matinh.vdldoc</groupId>
<artifactId>vdldoc-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
</plugins>
</reporting>
然后运行mvn site 来生成文档。有关详细信息,请参阅插件主页。