maven打包时出现Error while generating Javadoc问题解决方案

  • 1
  • 4,660次阅读
  • A+
所属分类:Maven

使用 mvn clean install -Dmaven.test.skip=true 命令打包时出现如下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:jar (attach-javadocs) on project city-brain-common-job-core: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - test7/src/main/java/com/dangdang/ddframe/job/lite/internal/resource/test8.java:40: 警告: @return 没有说明
[ERROR]      * @return
[ERROR]        ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test1.java:10: 错误: 未知标escription
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test1.java:11: 错误: 未知标Author
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test1.java:12: 错误: 未知标ate
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test1.java:13: 错误: 未知标 Copyright
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test2.java:4: 错误: 未知标记: Description
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test2.java:5: 错误: 未知标记: Author
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test2.java:6: 错误: 未知标记: date
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test2.java:7: 错误: 未知标记: Copyright
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test3.java:62: 警告: @param 没有说明
[ERROR]        ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test3.java:63: 警告: @return 没有说明
[ERROR]        ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test3.java:13: 错误: 未知标记: Description
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test3.java:14: 错误: 未知标记: Author
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test3.java:15: 错误: 未知标记: date
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test3.java:16: 错误: 未知标记: Copyright
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/ResourceGroup.java:8: 错误: 未知标记: Description
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test4.java:9: 错误: 未知标记: Author
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test4.java:10: 错误: 未知标记: date
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test4.java:11: 错误: 未知标记: Copyright
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test5.java:8: 错误: 未知标记: Descrin
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test5.java:9: 错误: 未知标记: Author
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test5.java:10: 错误: 未知标记: date
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test5.java:11: 错误: 未知标记: Copyright
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test6.java:6: 错误: 未知标记: Description
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test6.java:7: 错误: 未知标记: Author
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test6.java:8: 错误: 未知标记: date
[ERROR]    ^
[ERROR] /Users/lmx/Documents/liumengxitest/src/main/java/com/dangdang/ddframe/job/lite/internal/test/test6.java:9: 错误: 未知标记: Copyright
[ERROR]    ^
[ERROR] 
[ERROR] Command line was: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre/../bin/javadoc @options @packages
[ERROR] 
[ERROR] Refer to the generated Javadoc files in 'test6target/apidocs' dir.

是由于使用了 maven-javadoc-plugin的插件进行javadoc打包,解决这个问题的方案有两种:

  • 在使用maven打包时不适用maven-javadoc-plugin插件进行打包

  • 跳过javadoc打包方式,具体命令 mvn clean install -Dmaven.javadoc.skip=true -Dmaven.test.skip=true

如果使用跳过javadoc打包方式进行打包,遇到如下错误:

Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (sign-artifacts) on project qcloud-java-sdk: Unable to execute gpg command: Error while executing process. Cannot run program "gpg.exe": CreateProcess error=2, 系统找不到指定的文件。 -> [Help 1]

这个原因是没有添加maven-gpg-plugin相关插件,可以添加插件,或者选择跳过该命令。
具体命令 mvn clean install -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -Dgpg.skip

更多互联网软件解决方案分享以及互联网书籍请查看========>解决方案软件书籍分享

  • 我的微信
  • 加好友一起交流!
  • weinxin
  • 微信公众号
  • 关注公众号获取分享资源!
  • weinxin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:1   其中:访客  1   博主  0

    • 王帅强 王帅强 0

      https://www.mxblog.com.cn/maven%E6%89%93%E5%8C%85%E6%97%B6%E5%87%BA%E7%8E%B0error-while-generating-javadoc%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88.html