开发者

using Enunciate with Maven/multiple modules

开发者 https://www.devze.com 2023-04-11 04:22 出处:网络
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

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/enu开发者_JS百科nciate/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?


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.


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>


Instead of api-classes can you try api-import

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

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

精彩评论

暂无评论...
验证码 换一张
取 消