加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java 1.8上的maven-enunciate-plugin现在从最新的JDK中删除了(即

发布时间:2020-12-15 00:54:50 所属栏目:Java 来源:网络整理
导读:问题是如何让 java 1.8和maven-enunciate-plugin一起工作? 使用maven插件org.codehaus.enunciate版本1.29和OSX JDK 1.7.0_25都很好. Enunciate取决于apt,我在1.7.0_25中看到此运行时警告 [INFO] invoking enunciate:generate step… warning: The apt tool
问题是如何让 java 1.8和maven-enunciate-plugin一起工作?

使用maven插件org.codehaus.enunciate版本1.29和OSX JDK 1.7.0_25都很好.
Enunciate取决于apt,我在1.7.0_25中看到此运行时警告

[INFO] invoking enunciate:generate step…

warning: The apt tool and its associated API are planned to be removed
in the next major JDK release. These features have been superseded by
javac and the standardized annotation processing API,
javax.annotation.processing and javax.lang.model. Users are
recommended to migrate to the annotation processing features of javac;
see the javac man page for more information.

当更改为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

解决方法

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读