javadoc仅在我的Module项目之一上失败

javadoc仅在我的Module项目之一上失败

本文介绍了mvn javadoc:javadoc仅在我的Module项目之一上失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Sub modules项目确实有一个非常奇怪的问题.

I have really very strange problem with my Sub modules project.

项目结构如下.

TestPomProject

TestPomProject

* DAOProject
* SchemaProject
* EJBProject
* EarProject

如果我在这些项目(DAOProject,SchemaProject,EarProject)上执行"mvn javadoc:javadoc"命令,则工作正常且成功完成.

If i execute "mvn javadoc:javadoc" command on these projects ( DAOProject, SchemaProject, EarProject ) It's working fine and completed successfully.

但是,当我在EJBProject上执行此命令时,它给了我以下异常,并且EJBProject中的javadoc没有任何不同的条目,而javadoc插件都具有相同的条目........

But when i execute this command at EJBProject it's giving me following exception and there isn't any different entry for javadoc in EJBProject all having same entry for javadoc plugin ........

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building EJBProject 3.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-javadoc-plugin:2.8:javadoc (default-cli) @ EJBProject >>>
[INFO]
[INFO] <<< maven-javadoc-plugin:2.8:javadoc (default-cli) @ EJBProject <<<
[INFO]
[INFO] --- maven-javadoc-plugin:2.8:javadoc (default-cli) @ EJBProject ---
[INFO]
..............
.................
Standard Doclet version 1.6.0_29
Building tree for all the packages and classes
...............
.................
44 warnings
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.547s
[INFO] Finished at: Wed Dec 21 16:47:57 PST 2011
[INFO] Final Memory: 8M/20M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.8:javadoc (default-cli) on project EJBProject : An error has occurred in JavaDocs report generation:
[ERROR] Exit code: 1 - C:\jboss\workspace\TestPomProject\EJBProject\src\main\java\com\SampleEJB.java:6: package javax.ejb does not exist
[ERROR] import javax.ejb.Local;
[ERROR] ^
[ERROR] C:\jboss\workspace\TestPomProject\EJBProject\src\main\java\com\SampleEJB.java:7: package javax.ejb does not exist
[ERROR] import javax.ejb.Remote;
[ERROR] ^
[ERROR] \jboss\workspace\TestPomProject\EJBProject\src\main\java\com\SampleEJB.java:8: package javax.ejb does not exist
[ERROR] import javax.ejb.SessionContext;
[ERROR] ^

........................
...................

[ERROR] @EJB
[ERROR] ^
[ERROR] java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc
[ERROR] at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl.java:46)
[ERROR] at com.sun.tools.doclets.internal.toolkit.util.Util.isDeprecated(Util.java:811)
[ERROR] at com.sun.tools.doclets.formats.html.ClassWriterImpl.writeClassDeprecationInfo(ClassWriterImpl.java:242)
[ERROR] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.buildDeprecationInfo(ClassBuilder.java:229)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:597)
[ERROR] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.invokeMethod(ClassBuilder.java:101)
[ERROR] at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
[ERROR] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.buildClassDoc(ClassBuilder.java:124)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:597)
[ERROR] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.invokeMethod(ClassBuilder.java:101)
[ERROR] at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
[ERROR] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(ClassBuilder.java:108)
[ERROR] at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:155)
[ERROR] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:164)
[ERROR] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:106)
[ERROR] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
[ERROR] at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
[ERROR] at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:597)
[ERROR] at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:269)
[ERROR] at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:143)
[ERROR] at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
[ERROR] at com.sun.tools.javadoc.Start.begin(Start.java:128)
[ERROR] at com.sun.tools.javadoc.Main.execute(Main.java:41)
[ERROR] at com.sun.tools.javadoc.Main.main(Main.java:31)
[ERROR] java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc

_________________________________________________________________________________________________________

有趣的是,mvn install命令对IMPORT语句没有任何抱怨,它可以成功构建它!!!!

And the interesting thing is mvn install command doesn't complain me anything about IMPORT statements and it build it successfully !!!!

请给我一些想法,这是怎么了?发生了什么事?

Please give me some idea what's wrong here ?? What's going on ?

推荐答案

此问题的正确解决方案是使用JDK 1.7版本,这是JDK 1.6版本的问题.并且已在Jdk 1.7中修复.

Correct solution for this problem is to use JDK 1.7 version and this is a issue with JDK 1.6 version. and it's fixed in Jdk 1.7.

http://bugs.sun.com/bugdatabase/view_bug.do? bug_id = 6709246

这篇关于mvn javadoc:javadoc仅在我的Module项目之一上失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 08:19