Javadoc:来自第三方库的注释

发布于 2024-10-22 21:21:51 字数 887 浏览 0 评论 0原文

我正在尝试编写一个 SVN Post-Commit 挂钩,以便每当有人提交对相关文件的任何更改时在网页上生成 javadoc。

我对钩子概念很陌生,但我没想到在生成 javadoc 时会遇到任何奇怪的错误。

java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc
    at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl.java:46)
    at com.sun.tools.doclets.internal.toolkit.util.Util.isDeprecated(Util.java:811)
    at com.sun.tools.doclets.formats.html.AbstractIndexWriter.printComment(AbstractIndexWriter.java:186)

在 StackOverFlow 上进行了几次成功搜索后,我发现它与第三方注释有关。 (我使用 Play 框架并使用许多其他库)

所以我将所有内容都包含在脚本中:

#!/bin/sh

CLASSPATH="~/Play/play-1.1.1/;"

javadoc -d ~/svndoc/ -classpath $CLASSPATH -sourcepath ~/svntest/avon/trunk/ScoreDB/app @packages

但这会产生完全相同的错误。有时有 10 个警告,但大多数时候有 27 个。

你们能帮我一下吗?

提前致谢, 碧玉

I'm trying to write an SVN Post-Commit hook to generate javadoc on a webpage whenever someone submits any changes to relevant files.

I was new to the hook concept, but I didn't expect to run in any strange errors when generating the javadoc.

java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc
    at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl.java:46)
    at com.sun.tools.doclets.internal.toolkit.util.Util.isDeprecated(Util.java:811)
    at com.sun.tools.doclets.formats.html.AbstractIndexWriter.printComment(AbstractIndexWriter.java:186)

After a few succesful searches on StackOverFlow I discovered it had something to do with third-party-annotations. (I make use of the Play framework and that uses a number of other libraries)

So I included everything in a script:

#!/bin/sh

CLASSPATH="~/Play/play-1.1.1/;"

javadoc -d ~/svndoc/ -classpath $CLASSPATH -sourcepath ~/svntest/avon/trunk/ScoreDB/app @packages

But this generates the exact same errors. Sometimes there are 10 warnings, but most of the time there are 27 of them.

Could you guys help me out?

Thanks in advance,
Jasper

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽梦忆笙歌 2024-10-29 21:21:51

你的类路径看起来不对。首先,里面不能有;(在Unix中,分隔符是:,但最后不需要)。其次,这个目录中真的有各个类文件吗?如果有 jar 文件,您需要单独列出它们,或者在其中放置 * (但请注意 bash 不会扩展它,因为您需要 :之间的空格)。

不过,我不知道这是否能解决问题。

Your classpath looks wrong. First, there should be no ; in it (in Unix, the separator is :, but it is not needed at the end). Secondly, do you really have the individual class files in this directory? If there are jar files, you need to either list them individually, or put a * there (but pay attention that bash does not expand it, since you would need : instead of spaces between).

I have no idea if this would solve the problem, though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文