Maven错误:-fuzzyMatcher TYPEVAR

时间:2016-05-19 20:27:46

标签: java maven javadoc

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:jar (package-javadocs) on project globalmentor-core: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - javadoc: error - fuzzyMatcher TYPEVAR
[ERROR]
[ERROR] Command line was: "C:\Program Files\Java\jdk1.8.0_92\jre\..\bin\javadoc.exe" @options @packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in 'C:\Users\magno\Documents\Globalmentor\globalmentor-core\target\apidocs' dir.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:jar (package-javadocs) on project globalmentor-core: MavenReportException: Error while generating Javadoc:
Exit code: 1 - javadoc: error - fuzzyMatcher TYPEVAR

Command line was: "C:\Program Files\Java\jdk1.8.0_92\jre\..\bin\javadoc.exe" @options @packages

Refer to the generated Javadoc files in 'C:\Users\magno\Documents\Globalmentor\globalmentor-core\target\apidocs' dir.

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: MavenReportException: Error while generating Javadoc:
Exit code: 1 - javadoc: error - fuzzyMatcher TYPEVAR

Command line was: "C:\Program Files\Java\jdk1.8.0_92\jre\..\bin\javadoc.exe" @options @packages

Refer to the generated Javadoc files in 'C:\Users\magno\Documents\Globalmentor\globalmentor-core\target\apidocs' dir.

    at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.failOnError(AbstractJavadocMojo.java:6018)
    at org.apache.maven.plugin.javadoc.JavadocJar.execute(JavadocJar.java:192)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    ... 20 more
Caused by: org.apache.maven.reporting.MavenReportException:
Exit code: 1 - javadoc: error - fuzzyMatcher TYPEVAR

Command line was: "C:\Program Files\Java\jdk1.8.0_92\jre\..\bin\javadoc.exe" @options @packages

Refer to the generated Javadoc files in 'C:\Users\magno\Documents\Globalmentor\globalmentor-core\target\apidocs' dir.

    at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.executeJavadocCommandLine(AbstractJavadocMojo.java:5163)
    at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.executeReport(AbstractJavadocMojo.java:2075)
    at org.apache.maven.plugin.javadoc.JavadocJar.execute(JavadocJar.java:188)
    ... 22 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

有人可以帮我解决这个错误吗?我在javadocs上遇到了一些问题,有一段时间它在POM上使用了这些额外的行来解决这个问题:

<!-- turn off Javadoc errors from warnings; requires JDK 8 -->
<additionalparam>-Xdoclint:none</additionalparam>

现在问题是需要修复所有javadoc错误才能使这个库准备好上传到maven,所有的javadoc错误都已修复,但是这个问题仍然存在。对此有何解决方案?我在任何地方都找不到这种错误。

这是POM,看看是否有人可以帮助我找到可能存在的错误,因为很多评论都提到了这个:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.globalmentor</groupId>
<artifactId>globalmentor-core</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>GlobalMentor Core</name>
<url>http://www.globalmentor.com/</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>1.3</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
        <version>3.0.0</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <resources>
        <resource>
            <directory>src/main/javascript</directory>
        </resource>
    </resources>

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<profiles>
    <profile>
        <id>release</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.1.2</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.3</version>
                    <configuration>
                        <bottom><![CDATA[<em>Copyright © 1996-2012 GlobalMentor, Inc. All Rights Reserved.</em>]]></bottom>
                        <quiet>true</quiet>
                    </configuration>
                    <executions>
                        <execution>
                            <id>package-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                            <configuration>
                                <additionalparam>-Xdoclint:all</additionalparam>
                                <useStandardDocletOptions>false</useStandardDocletOptions>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

这是我正在使用的Maven和JVM的版本:

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T14:41:47-02:00)
Java version: 1.8.0_92, vendor: Oracle Corporation

1 个答案:

答案 0 :(得分:-1)

UPDATE:

Oracle声明:Doclint, a new feature of Java 8.

  

javax.tools包中包含启用的类和接口   您可以直接从Java应用程序调用Javadoc工具,   没有执行新的过程。 javadoc tool现在支持   检查javadoc注释的内容以查找可能导致的问题   各种问题,例如无效的HTML或可访问性问题   由javadoc生成的文件。该功能已启用   默认,也可以通过新的-Xdoclint选项控制。

但是当我们想要在编码中实现时,发生了一些问题和错误

Stephen Colebourne's blog开始,我们得到了

高达JDK 7 ,Javadoc工具非常宽松。作为开发人员,您可以编写任何与HTML模糊相似的内容,并且该工具很少会出现警告。因此,您可能会有@link个不准确的引用(例如由于重构),该工具只会提供警告。

使用JDK 8 ,除非您的工具符合doclint标准,否则无法获得Javadoc。它的一些规则是:

  1. 没有自我关闭的HTML代码,例如<br /><a id="x" />
  2. 没有未公开的HTML标记,例如<ul>没有匹配</ul>
  3. 没有无效的HTML结束标记,例如</br>
  4. 没有无效的HTML属性,基于doclint对W3C的解释 HTML 4.01
  5. 没有重复的HTML ID属性
  6. 没有空的HTML href属性
  7. 没有错误的嵌套标题,例如类文档必须具有 <h3>,而不是<h4>
  8. 没有无效的HTML标记,例如List<String>(您忘了 使用&lt;
  9. 逃生
  10. 没有损坏的@link参考
  11. 没有损坏的@param引用,它们必须与实际参数匹配  名称
  12. 没有损坏的@throws引用,第一个单词必须是类名
  13. 请注意,这些是错误,而不是警告。打破规则,你就得不到Javadoc输出。

    解决方案:

    简而言之,如果我们想要提供解决方案,那么你必须做出 - Xdoclint:none

    link

    中给出了一个示例

    但是如果你想让它可以运行,那么你必须克服JDK 8的上述标准。

    When this problem will be fixed by Oracle?

    我们可能要等到Java 9.

    资源链接:

    1. Maven is not working in Java 8 when JavaDoc tags are incomplete
    2. 一旦指定,

      <useStandardDocletOptions>必须设置为false。将useStandardDocletOptions设为false并在additionalparam之后使用此行,如下所示。

      <additionalparam>-Xdoclint:all</additionalparam>
      <useStandardDocletOptions>false</useStandardDocletOptions>
      

      资源链接:

      https://issues.apache.org/jira/browse/MJAVADOC-229