如何在WAR中打包docs工件

时间:2013-03-13 15:31:45

标签: java web-applications maven-3 war enunciate

我已经集成了maven-enunciate-plugin,以便在构建期间生成文档并将其输出到目标目录下的docs目录。由于我是Maven的新手,我想知道什么是配置我的构建的理想方式,以便它将docs目录打包到我的构建的WAR工件中。目前它不在WAR之外。 谢谢, 麦克

1 个答案:

答案 0 :(得分:0)

请查看thisthis

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <!--
            Exclude JCL and LOG4J since all logging should go through SLF4J.
            Note that we're excluding log4j-<version>.jar but keeping
            log4j-over-slf4j-<version>.jar
          -->
          <packagingExcludes>
            WEB-INF/lib/commons-logging-*.jar,
            %regex[WEB-INF/lib/log4j-(?!over-slf4j).*.jar]
          </packagingExcludes>                               
          <packagingIncludes>
            **/docs
          </packagingIncludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  ...
</project>