首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Enunciate生成的压缩文档

使用Enunciate生成的压缩文档
EN

Stack Overflow用户
提问于 2013-06-13 16:43:07
回答 2查看 762关注 0票数 1

我正在使用Enunciate作为生成API文档的Maven插件。我想压缩生成的文档,但到目前为止还找不到这样做的方法。将生成文档,但它位于一个目录中,而不是zip文件中。以下是我的pom的摘录:

代码语言:javascript
复制
            <plugin>
            <!-- auto-generate docs for REST API -->
            <groupId>org.codehaus.enunciate</groupId>
            <artifactId>maven-enunciate-plugin</artifactId>
            <configuration>
                <configFile>enunciate.xml</configFile>
                <!-- the directory where to put the docs -->
                <docsDir>${project.parent.basedir}/VrmMisc/Docs/SMA_API</docsDir>
                <!-- <docsSubdir>${project.parent.basedir}/VrmMisc/Docs/SMA_API</docsSubdir> -->

            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>docs</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

依赖关系:

代码语言:javascript
复制
        <dependency>
        <groupId>org.codehaus.enunciate</groupId>
        <artifactId>enunciate-rt</artifactId>
        <version>${enunciate.plugin.version}</version>
        <exclusions>
               <exclusion>
                <artifactId>activation</artifactId>
                <groupId>javax.activation</groupId>
            </exclusion>
            <exclusion>
                <artifactId>enunciate-jaxws-ri-rt</artifactId>
                <groupId>org.codehaus.enunciate</groupId>
            </exclusion>
            <exclusion>
                <artifactId>enunciate-jersey-rt</artifactId>
                <groupId>org.codehaus.enunciate</groupId>
            </exclusion>
            <exclusion>
                <artifactId>jersey-server</artifactId>
                <groupId>com.sun.jersey</groupId>
                </exclusion>
        </exclusions>
    </dependency>

我使用的是版本1.26.2的表述。

EN

回答 2

Stack Overflow用户

发布于 2013-07-07 04:07:25

如果您告诉Enunciate将"docs“工件”导出“到一个文件(而不是一个目录)中,则Enunciate将为您将其压缩:

代码语言:javascript
复制
    <plugin>
        <!-- auto-generate docs for REST API -->
        <groupId>org.codehaus.enunciate</groupId>
        <artifactId>maven-enunciate-plugin</artifactId>
        <configuration>
            <configFile>enunciate.xml</configFile>
            <exports>
                <docs>${project.parent.basedir}/VrmMisc/Docs/SMA_API.zip</docs>
            </exports>
        </configuration>
        <executions>
            <execution>
                <goals>
                    <goal>docs</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
票数 2
EN

Stack Overflow用户

发布于 2014-05-29 20:09:17

另一种解决方案是运行Shell命令,使WAR文件可以轻松地部署到Tomcat上

代码语言:javascript
复制
#!/bin/bash
filename=enunciate.war
directory=enunciate_directory
echo $filename building starts ...
cd $directory
jar -cf $filename *
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17082801

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档