using Enunciate with Maven/multiple modules

2.4k Views Asked by At

I have multiple Maven modules that expose various REST for my service. On top of that, I have an (almost empty) module, called project-docs, that I want to use and generate an aggregated Enunciate api documentation. Unfortunately, Enunciate really expects some (if not all) the REST to be found within the module where it gets executed.

I have tried this https://github.com/stoicflame/enunciate/wiki/Multi-Module-Projects-%28Version-1%29, but doesn't seem to work. Furthermore, I haven't found any tutorial/description of the for org.codehaus.enunciate:maven-enunciate-plugin.

Looking at the link above, I have explicitly exposed the source code from one of modules, and it gets copied to target/enunciate-scratch directory. However, I think I'm missing some configuration options.

Can anyone help?

3

There are 3 best solutions below

0
On

Did you try adding the dependency in the project-docs module? Looks like enunciate requires that the class files should be available in classpath and also imported in enunciate xml file.

0
On

Instead of api-classes can you try api-import

 <!--<api-classes>
    <include pattern="com.example.**"/>    
  </api-classes> -->

  <api-import pattern="com.example.**"/>    
1
On

I'm not sure what "doesn't seem to work" means, but if you have no REST endpoints in the enunciate-applied project, you may have to explicitly "include" these endpoints:

<enunciate>
  <api-classes>
    <include pattern="org.mycompany.**"/>
  </api-classes>
</enunciate>