将 Enunciate 与 Maven/多个模块结合使用

发布于 2024-12-07 17:20:37 字数 569 浏览 1 评论 0原文

我有多个 Maven 模块,它们为我的服务公开了各种 REST。最重要的是,我有一个(几乎是空的)模块,称为项目文档,我想使用它并生成聚合的 Enunciate api 文档。不幸的是,Enunciate 确实希望在执行它的模块中找到一些(如果不是全部)REST。

我已经尝试过这个 https://github.com /stoicflame/enunciate/wiki/Multi-Module-Projects-%28Version-1%29,但似乎不起作用。此外,我还没有找到 org.codehaus.enunciate:maven-enunciate-plugin 的任何教程/描述。

查看上面的链接,我已明确公开其中一个模块的源代码,并将其复制到 target/enunciate-scratch 目录。但是,我认为我缺少一些配置选项。

有人可以帮忙吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

薔薇婲 2024-12-14 17:20:37

您是否尝试在项目文档模块中添加依赖项?看起来 enunciate 要求类文件应在类路径中可用,并且也应在 enunciate xml 文件中导入。

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.

深海少女心 2024-12-14 17:20:37

我不确定“似乎不起作用”是什么意思,但如果您在阐明应用的项目中没有 REST 端点,则可能必须显式“包含”这些端点:

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

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>
注定孤独终老 2024-12-14 17:20:37

您可以尝试 api-import 而不是 api-classes

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

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

Instead of api-classes can you try api-import

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

  <api-import pattern="com.example.**"/>    
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文