MAVEN packaging error when generating Javadoc problem

Source: Internet
Author: User

Project is based on MAVEN management, has been packaged all right, today packaging inexplicable a lot of mistakes
[ERROR] Java.lang.ClassCastException:com.sun.tools.javadoc.ClassDocImpl cannot is 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.TagletWriterImpl.deprecatedTagOutput (tagletwriterimpl.java:85 ) [ERROR] at Com.sun.tools.doclets.internal.toolkit.taglets.DeprecatedTaglet.getTagletOutput ( DEPRECATEDTAGLET.JAVA:40) [ERROR] at com.sun.tools.doclets.formats.html.MethodWriterImpl.writeDeprecated ( methodwriterimpl.java:166) [ERROR] at Com.sun.tools.doclets.internal.toolkit.builders.MethodBuilder.buildDeprecationInfo (methodbuilder.java:183) [ ERROR] at Sun.reflect.GeneratedMethodAccessor3.invoke (Unknown Source) [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.MethodBuilder.invokeMethod (methodbuilder.java:109) [ERROR] at Com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build (ABSTRACTBUILDER.JAVA:90) [ERROR] at Com.sun.tools.doclets.internal.toolkit.builders.AbstractMemberBuilder.build (abstractmemberbuilder.java:56) [ ERROR] at Com.sun.tools.doclets.internal.toolkit.builders.MethodBuilder.buildMethodDoc (methodbuilder.java:150) [ 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.MethodBuilder.invokeMethod (methodbuilder.java:109) [ERROR] at Com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build (ABSTRACTBUILDER.JAVA:90) [ERROR] at Com.sun.tools.doclets.internal.toolkit.buildERs. Abstractmemberbuilder.build (abstractmemberbuilder.java:56) [ERROR] at Com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.buildMethodDetails (classbuilder.java:322) [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)

Did not study for a long time, and finally tried a number of commands, such as: Pakage, test and other commands are not error, only when using install error. Look closely at the log, the final suspicion is in the generation of Javadoc when the error, and try install-d maven.javadoc.skip=true command to skip the generation Javadoc part, sure enough no error.

Careful study of the next, the original Maven Javadoc plugin version of the problem, resulting in the time to generate this error. Increase in POM

<build><finalName>biz-statistics</finalName> <resources> <resource> <directory>${project.basedir}/src/main/resources</directory> <filtering>true< /filtering> </resource> </resources><plugins> <plugin> <artifacti            D>maven-javadoc-plugin</artifactid> <version>2.9.1</version> <executions> <execution> <id>attach-javadocs</id> <phase>install</phase&gt              ;                <goals> <goal>jar</goal> </goals> <configuration>          <encoding>UTF-8</encoding> </configuration> </execution> </executions> <configuration> <encoding>UTF-8</encoding> </c OnfiguratIon> </plugin> </plugins></build> 

You can set the version number.

MAVEN packaging error when generating Javadoc problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.