gpt4 book ai didi

java - 为什么 mvn javadoc :fix shows success while in the same project mvn javadoc:javadoc fails afterwards?

转载 作者:行者123 更新时间:2023-12-03 23:45:06 28 4
gpt4 key购买 nike

我正在尝试将现有的 Javadoc 修复到 project .
我在运行 mvn javadoc:fix .它成功执行但没有修复一些 Javadocs。
Maven Javadoc插件的配置:

[DEBUG] Configuring mojo org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:fix from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-javadoc-plugin:3.2.0, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@799f7e29]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:fix' with basic configurator -->
[DEBUG] (f) comparisonVersion = (,1.2.0)
[DEBUG] (f) defaultSince = 1.2.0
[DEBUG] (f) defaultVersion = $Id: $Id
[DEBUG] (f) encoding = UTF-8
[DEBUG] (f) fixClassComment = true
[DEBUG] (f) fixFieldComment = true
[DEBUG] (f) fixMethodComment = true
[DEBUG] (f) fixTags = all
[DEBUG] (f) ignoreClirr = false
[DEBUG] (f) includes = **\/*.java
[DEBUG] (f) level = protected
[DEBUG] (f) localRepository = id: local
url: file:///Users/dmytro/.m2/repository/
layout: default
snapshots: [enabled => true, update => always]
releases: [enabled => true, update => always]

[DEBUG] (f) outputDirectory = /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/java
[DEBUG] (f) project = MavenProject: com.github.chameleontartu:amazon-mws-feeds-maven:1.2.0 @ /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/pom.xml
[DEBUG] (f) removeUnknownThrows = true
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@2f1ea80d
[DEBUG] (f) settings = org.apache.maven.execution.SettingsAdapter@2ce56d1c
[DEBUG] -- end configuration --
mvn javadoc:javadoc 的部分输出:
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:javadoc from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-javadoc-plugin:3.2.0, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@799f7e29]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:javadoc' with basic configurator -->
[DEBUG] (f) applyJavadocSecurityFix = true
[DEBUG] (f) author = true
[DEBUG] (f) bootclasspathArtifacts = []
[DEBUG] (f) bottom = Copyright © {inceptionYear}–{currentYear} {organizationName}. All rights reserved.
[DEBUG] (f) breakiterator = false
[DEBUG] (f) debug = false
[DEBUG] (s) destDir = apidocs
[DEBUG] (f) detectJavaApiLink = true
[DEBUG] (f) detectLinks = false
[DEBUG] (f) detectOfflineLinks = false
[DEBUG] (f) docencoding = UTF-8
[DEBUG] (f) docfilessubdirs = false
[DEBUG] (f) docletArtifact = groupId = 'null'
artifactId = 'null'
version = 'null'
[DEBUG] (f) docletArtifacts = []
[DEBUG] (f) doctitle = Amazon MWS :: Feeds 1.2.0 API
[DEBUG] (f) encoding = UTF-8
[DEBUG] (f) failOnError = true
[DEBUG] (f) failOnWarnings = false
[DEBUG] (f) includeDependencySources = false
[DEBUG] (f) includeTransitiveDependencySources = false
[DEBUG] (f) isOffline = false
[DEBUG] (f) javaApiLinks = {}
[DEBUG] (f) javadocDirectory = /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/javadoc
[DEBUG] (f) javadocOptionsDir = /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/target/javadoc-bundle-options
[DEBUG] (f) keywords = false
[DEBUG] (f) links = []
[DEBUG] (f) linksource = false
[DEBUG] (f) localRepository = id: local
url: file:///Users/dmytro/.m2/repository/
layout: default
snapshots: [enabled => true, update => always]
releases: [enabled => true, update => always]

[DEBUG] (f) mojo = org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:javadoc {execution: default-cli}
[DEBUG] (f) nocomment = false
[DEBUG] (f) nodeprecated = false
[DEBUG] (f) nodeprecatedlist = false
[DEBUG] (f) nohelp = false
[DEBUG] (f) noindex = false
[DEBUG] (f) nonavbar = false
[DEBUG] (f) nooverview = false
[DEBUG] (f) nosince = false
[DEBUG] (f) notimestamp = false
[DEBUG] (f) notree = false
[DEBUG] (f) offlineLinks = []
[DEBUG] (f) old = false
[DEBUG] (f) outputDirectory = /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/target/apidocs
[DEBUG] (f) overview = /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/javadoc/overview.html
[DEBUG] (f) project = MavenProject: com.github.chameleontartu:amazon-mws-feeds-maven:1.2.0 @ /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/pom.xml
[DEBUG] (f) quiet = true
[DEBUG] (f) reactorProjects = [MavenProject: com.github.chameleontartu:amazon-mws-feeds-maven:1.2.0 @ /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/pom.xml]
[DEBUG] (s) reportOutputDirectory = /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/target/site/apidocs
[DEBUG] (f) resourcesArtifacts = []
[DEBUG] (f) serialwarn = false
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@7d78f3d5
[DEBUG] (f) settings = org.apache.maven.execution.SettingsAdapter@a4b5ce3
[DEBUG] (f) show = protected
[DEBUG] (f) skip = false
[DEBUG] (f) source = 1.6
[DEBUG] (f) sourceDependencyCacheDir = /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/target/distro-javadoc-sources
[DEBUG] (f) splitindex = false
[DEBUG] (f) staleDataPath = /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/target/maven-javadoc-plugin-stale-data.txt
[DEBUG] (f) stylesheet = java
[DEBUG] (f) tagletArtifact = groupId = 'null'
artifactId = 'null'
version = 'null'
[DEBUG] (f) tagletArtifacts = []
[DEBUG] (f) taglets = []
[DEBUG] (f) tags = []
[DEBUG] (f) use = true
[DEBUG] (f) useStandardDocletOptions = true
[DEBUG] (f) validateLinks = false
[DEBUG] (f) verbose = false
[DEBUG] (f) version = true
[DEBUG] (f) windowtitle = Amazon MWS :: Feeds 1.2.0 API
[DEBUG] -- end configuration --
[DEBUG] Found Java API link: https://docs.oracle.com/javase/6/docs/api/
[INFO] No previous run data found, generating javadoc.
[DEBUG] /Users/dmytro/.sdkman/candidates/java/current/bin/javadoc @options @packages
[INFO]
100 errors
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.642 s
[INFO] Finished at: 2020-08-06T15:55:56+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:javadoc (default-cli) on project amazon-mws-feeds-maven: An error has occurred in Javadoc report generation:
[ERROR] Exit code: 1 - /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/java/com/amazonaws/mws/feeds/model/GetReportRequestCountResponse.java:13: error: bad use of '>'
[ERROR] * <complexType>
[ERROR] ^
[ERROR] /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/java/com/amazonaws/mws/feeds/model/GetReportRequestCountResponse.java:14: error: bad use of '>'
[ERROR] * <complexContent>
[ERROR] ^
[ERROR] /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/java/com/amazonaws/mws/feeds/model/GetReportRequestCountResponse.java:15: error: bad use of '>'
[ERROR] * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
[ERROR] ^
[ERROR] /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/java/com/amazonaws/mws/feeds/model/GetReportRequestCountResponse.java:16: error: bad use of '>'
[ERROR] * <sequence>
[ERROR] ^
[ERROR] /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/java/com/amazonaws/mws/feeds/model/GetReportRequestCountResponse.java:17: error: bad use of '>'
[ERROR] * <element ref="{http://mws.amazonaws.com/doc/2009-01-01/}GetReportRequestCountResult"/>
[ERROR] ^
[ERROR] /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/java/com/amazonaws/mws/feeds/model/GetReportRequestCountResponse.java:18: error: bad use of '>'
[ERROR] * <element ref="{http://mws.amazonaws.com/doc/2009-01-01/}ResponseMetadata"/>
[ERROR] ^
[ERROR] /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/java/com/amazonaws/mws/feeds/model/GetReportRequestCountResponse.java:19: error: bad use of '>'
[ERROR] * </sequence>
[ERROR] ^
[ERROR] /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/java/com/amazonaws/mws/feeds/model/GetReportRequestCountResponse.java:20: error: bad use of '>'
[ERROR] * </restriction>
[ERROR] ^
[ERROR] /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/java/com/amazonaws/mws/feeds/model/GetReportRequestCountResponse.java:21: error: bad use of '>'
[ERROR] * </complexContent>
[ERROR] ^
[ERROR] /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/java/com/amazonaws/mws/feeds/model/GetReportRequestCountResponse.java:22: error: bad use of '>'
[ERROR] * </complexType>
[ERROR] ^
[ERROR] /Users/dmytro/Documents/projects/amazon-mws-feeds-maven/src/main/java/com/amazonaws/mws/feeds/model/GetReportRequestCountResponse.java:25: error: self-closing element not allowed
[ERROR] * <p/>
[ERROR] ^
在类似的项目中,在它起作用之前我只是不明白我做错了什么?
Maven/Java 详细信息:
$ mvn --version
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T21:00:29+02:00)
Maven home: /Users/dmytro/.sdkman/candidates/maven/current
Java version: 11.0.2, vendor: Oracle Corporation, runtime: /Users/dmytro/.sdkman/candidates/java/11.0.2-open
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.6", arch: "x86_64", family: "mac"

最佳答案

AWS 最有可能使用 JAXB 来生成您的 Web 服务模型。
JAXB 有一个 issue包括它没有正确逃脱 >带有 gt; 的符号生成 Java Artifact 时。
在 JDK 1.8 之前,这不是问题。
但是,从 JDK 8 开始,javadoc工具包括 doclint .这个新部分将检查您的代码是否符合 HTML 4.01 specification并且会为它发现的每个不符合项生成错误。
其中,会报告上述问题的错误和其他导致javadoc:javadoc的不符合项。 Maven 项目中的目标失败。
This excelent articlejavadoc 中详细解释了这一变化工具。
为避免该错误,成功生成文档,并将 Artifact 部署到 Maven 中心,您可以修改 javadoc maven 插件配置并禁用 doclint :

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<attach>true</attach>
<source>${jdk.version}</source>
<!-- <quiet>true</quiet>-->
<detectOfflineLinks>false</detectOfflineLinks>
<encoding>${project.build.sourceEncoding}</encoding>
<doclint>none</doclint>
</configuration>
</plugin>
请注意包含 <doclint>元素。
您可以禁用 doclint完全(如示例中所示),或将其使用限制为 certain group s .
这个谜题只剩下一块了:为什么 javadoc: fix 没有目标修复这些错误。老实说,我不能给你一个答案:我不知道这是一个错误(我猜不是),或者只是该工具没有修复这些类型的错误。我希望有人可以对这个问题有所了解。

关于java - 为什么 mvn javadoc :fix shows success while in the same project mvn javadoc:javadoc fails afterwards?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63285289/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com