8

Question is how to get java 1.8 and maven-enunciate-plugin to work together ?

With maven plugin org.codehaus.enunciate version 1.29 and OSX JDK 1.7.0_25 all is good. Enunciate depends on apt and I see this runtime warning in 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.

When change to 1.8.0_05 build fails ...

apt is indeed gone, hence runtime errors regarding com.sun.mirror.apt.AnnotationProcessorFactory not found.

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
k1eran
  • 4,492
  • 8
  • 50
  • 73

1 Answers1

6

EDIT July 2015: This original question and this answer were written when Enunciate 1.x was the latest. Though 1.x still doesn't support java 1.8, as described in comments below, 2.0 M-1, now does have limited support for java 1.8, i.e. documentation generated but not API modules.

As recommended by @bmargulies I looked at JIRA page (which I guess I should have done in first place!) Paraphrasing JIRA ENUNCIATE-701

" No timeline yet for Enunciate / JDK8 compatibility."

Enunciate has moved to Github; the issue there is #68

k1eran
  • 4,492
  • 8
  • 50
  • 73
  • First milestone of Enunciate 2 is out now. – Wivani Jul 22 '15 at 09:18
  • @Wivani Issue #68 regarding JDK8 seems still open ? Is that just a oversight as I happily read at https://github.com/stoicflame/enunciate/releases/tag/v2.0.0-M.1 that Support for Java 8 is included (albeit that Milestone 1 still doesn't include support for client-side libraries yet) – k1eran Jul 22 '15 at 10:19
  • I'm just reporting ;-) Feel free to suggest to Stoicflame at github to close the issue but maybe he's not closing until later on (with the extra support etc like you mention) – Wivani Jul 22 '15 at 12:09
  • I'm facing this issue in my maven plugin. Was this issue resolved? What need to do to resolve this issue in my local Maven plugin. – Anil Reddy Yarragonda Aug 24 '16 at 11:47
  • any one used java8 with Enunciate – 1209 Mar 15 '21 at 15:47
  • 1
    Seems like they renamed the plugin to com.webcohesion.enunciate:enunciate-maven-plugin. Here's a link to Maven Central repo: https://search.maven.org/artifact/com.webcohesion.enunciate/enunciate-maven-plugin – varad Oct 22 '21 at 11:42