【问题标题】:Generate java client libraries using Enunciate使用 Enunciate 生成 java 客户端库
【发布时间】:2012-03-02 08:27:18
【问题描述】:

我有几个 RESTful Web 服务,我想使用 Maven 使用 Enunciate 1.25 记录。如果我在没有自定义 enunciate.xml 的情况下构建,所有客户端库都会按预期构建。

...
<build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.enunciate</groupId>
                <artifactId>maven-enunciate-plugin</artifactId>
                <version>${maven-enunciate-plugin.version}</version>
                <!-- configuration>
                    <configFile>src/main/resources/enunciate.xml</configFile>
                </configuration -->
                <executions>
                    <execution>
                        <goals>
                            <goal>assemble</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
...

只要我添加了我的自定义 enunciate.xml,Java 客户端库就不会生成

<?xml version="1.0"?>
<enunciate label="service/myservice" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.25.xsd">

    <modules>
        <docs splashPackage="myservice.service"
            includeDefaultDownloads="false" disableRestMountpoint="true"
            applyWsdlFilter="false" docsDir="api" title="My Service API"
            copyright="ME Inc" />
        <basic-app disabled="false" />
        <java-client disabled="false" />
        <xml disabled="false" />
        <jaxws-client disabled="false" />
        <jboss disabled="false" />
        <jaxws-ri disabled="true" />
        <jaxws-support disabled="true" />
        <csharp disabled="true" />
        <jersey disabled="true" />
        <c disabled="true" />
        <obj-c disabled="true" />
    </modules>

    <webapp disabled="false" mergeWebXML="../webapp/WEB-INF/web.xml" />

    <namespaces>
        <namespace uri="http://schema.me/services/myservice" id="myservice" />
    </namespaces>

    <services>
        <rest defaultRestSubcontext="/" />
    </services>

    <api-classes>
        <include pattern="myservice.service.*" />
    </api-classes>

</enunciate>

我可能做错了什么或遗漏了什么?

【问题讨论】:

  • 您是否从输出调试日志中获得任何信息(例如“mvn -X”)。您可能会看到类似“java-client 模块被禁用,因为...”

标签: rest documentation enunciate


【解决方案1】:

includeDefaultDownloads="false" 应该为真

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-23
    • 1970-01-01
    • 2012-11-13
    • 2019-07-26
    • 1970-01-01
    • 2022-10-05
    • 2016-03-28
    • 1970-01-01
    相关资源
    最近更新 更多