7

问题是如何让 java 1.8 和 maven-enunciate-plugin 一起工作?

使用 maven 插件org.codehaus.enunciate version 1.29和 OSX JDK1.7.0_25一切都很好。发音取决于apt,我看到这个运行时警告 1.7.0_25

[INFO] 调用发音:生成步骤...

警告:计划在下一个主要 JDK 版本中删除 apt 工具及其相关 API。这些特性已被 javac 和标准化注释处理 API、javax.annotation.processing 和 javax.lang.model 所取代。建议用户迁移到javac的注解处理特性;有关更多信息,请参见 javac 手册页。

当更改1.8.0_05构建失败时...

apt确实消失了,因此有关com.sun.mirror.apt.AnnotationProcessorFactory未找到的运行时错误。

mvn install -pl myProject -e -X

...

<snip>
urls[46] = file:/Users/k1/.m2/repository/org/codehaus/enunciate/enunciate-xml/1.29/enunciate-xml-1.29.jar
urls[47] = file:/Users/k1/.m2/repository/org/codehaus/enunciate/enunciate-java-client/1.29/enunciate-java-client-1.29.jar
urls[48] = file:/Users/k1/.m2/repository/org/codehaus/enunciate/enunciate-c/1.29/enunciate-c-1.29.jar
urls[49] = file:/Users/k1/.m2/repository/org/codehaus/enunciate/enunciate-obj-c/1.29/enunciate-obj-c-1.29.jar
urls[50] = file:/Users/k1/.m2/repository/org/codehaus/enunciate/enunciate-csharp/1.29/enunciate-csharp-1.29.jar
urls[51] = file:/Users/k1/.m2/repository/org/codehaus/enunciate/enunciate-ruby/1.29/enunciate-ruby-1.29.jar
urls[52] = file:/Users/k1/.m2/repository/org/codehaus/enunciate/enunciate-php/1.29/enunciate-php-1.29.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:165)
    ... 20 more
Caused by: java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactory
    at org.codehaus.enunciate.DocsMojo.loadMavenSpecificEnunciate(DocsMojo.java:107)
    at org.codehaus.enunciate.ConfigMojo.execute(ConfigMojo.java:326)
    at org.codehaus.enunciate.DocsMojo.execute(DocsMojo.java:81)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    ... 20 more
Caused by: java.lang.ClassNotFoundException: com.sun.mirror.apt.AnnotationProcessorFactory
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
    ... 24 more
[ERROR] 
[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/PluginContainerException
4

1 回答 1

5

编辑 2015 年 7 月:这个原始问题和这个答案是在 Enunciate 1.x 是最新版本时编写的。尽管 1.x 仍然不支持 java 1.8,如下面的评论中所述,2.0 M-1,现在对 java 1.8 的支持有限,即生成文档但不支持 API 模块。

正如@bmargulies 推荐的那样,我查看了 JIRA 页面(我想我应该首先这样做!)解释 JIRA ENUNCIATE-701

“ Enunciate / JDK8 兼容性尚无时间表。”

Enunciate 已移至 Github;问题是#68

于 2014-05-28T22:09:15.163 回答