Javadoc: Annotations from third party libraries

旧街凉风 提交于 2019-12-24 01:44: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


回答1:


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.



来源:https://stackoverflow.com/questions/5314738/javadoc-annotations-from-third-party-libraries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!