4

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?

Christoph Böhme
  • 3,766
  • 1
  • 19
  • 29
Alex Dobjanschi
  • 173
  • 1
  • 13

3 Answers3

2

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.

Thameem
  • 21
  • 2
1

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>
Ryan Heaton
  • 1,173
  • 7
  • 11
  • I've tried everything, I think Enunciate only determines the endpoints found in current module (looks for web.xml?). Let's say I have a module called `project-users`, that has endpoints for user manipulation (oauth, create, update, login, etc). And I have another module called `project-shop`, that expose other endpoints, for manipulation of other objects (shopping related). I want to construct a unified API app (.war) using Enunciate, that discovers all other endpoints. So, the 3rd module would be empty, and just build the unified API. I hope this is clearer, thanks. – Alex Dobjanschi Oct 05 '11 at 08:58
1

Instead of api-classes can you try api-import

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

  <api-import pattern="com.example.**"/>    
kalyan
  • 3,076
  • 1
  • 22
  • 29