I have really very strange problem with my Sub modules project.
Project Structure something like as below.
TestPomProject
* DAOProject
* SchemaProject
* EJBProject
* EarProject
If i execute "mvn javadoc:javadoc" command on these projects ( DAOProject, SchemaProject, EarProject ) It's working fine and completed successfully.
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
_________________________________________________________________________________________________________
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 ?