我正在尝试使用 CXF 的 Enunciate 插件通过配置如下的 Maven 插件为我的 REST 接口生成文档:
<plugin>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>maven-enunciate-cxf-plugin</artifactId>
<!-- check for the latest version -->
<version>1.21</version>
<executions>
<execution>
<goals>
<goal>docs</goal>
</goals>
<configuration>
<!-- the directory where to put the docs -->
<docsDir>${project.build}/docs </docsDir>
</configuration>
</execution>
</executions>
</plugin>
但是当我尝试运行插件时,我从命令行收到错误命令:
mvn clean install
错误是:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] 'docs' was specified in an execution, but not found in the plugin
[INFO] ------------------------------------------------------------------------
有什么建议么?
提前致谢,
马克
更新:我将插件更改为:
<plugin>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>maven-enunciate-plugin</artifactId>
<version>1.21</version>
<executions>
<execution>
<goals>
<goal>docs</goal>
</goals>
<configuration>
<docsDir>${project.build}/docs </docsDir>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>enunciate-rest</artifactId>
<version>1.21</version>
</dependency>
<dependency>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>enunciate-cxf-rt</artifactId>
<version>1.21</version>
</dependency>
</dependencies>
</plugin>
它可以工作,但我的 JSON 对象返回类型和参数没有被记录。