【发布时间】:2016-01-30 23:32:46
【问题描述】:
您好,我正在使用 ant war 插件并试图从 teh war 中排除一个文件夹。但是这并没有被排除在外。
这是结构
XYZ
src
main
webapp
web-inf
web.xml
common
api
a.js
b.js
我的 build.xml for target = production 看起来像这样,我试图排除公共文件夹。但是我看到它根本不排除它
<target name="production" depends="moveresources"
description="Building the Production Directory Content">
<echo message="Creating -> ${workingDirectory}"/>
<war destfile="${workingDirectory}/horizonadmin.war" webxml="${srcDirectory}/WEB-INF/web.xml">
<fileset dir="${webappsrc}"/>
<lib dir="${srcDirectory}/WEB-INF/lib"/>
<classes dir="${srcDirectory}/WEB-INF/classes"/>
<exclude name="common/api/*.js/>
</war>
<echo message="Done Creating -> ${workingDirectory}"/>
</target>
在我的 pom.xml 中,我将该文件夹引用为
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>production</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="unpackfolder" value="${unpack.folder}"/>
<property name="webappsrc" value="src/main/webapp"/>
<property name="srcDirectory" value="${project.basedir}/target"/>
<property name="workingDirectory" value="${PUBLISH_DIR}/production"/>
<ant antfile="${project.basedir}/build.xml" target="production"/>
</target>
</configuration>
</execution>
如何在我的 war 文件中排除这些 js 文件?用于生产模式。我打算排除这些 js 文件并包含一个缩小的 js 文件。任何指针
【问题讨论】:
-
您没有使用
maven-war-plugin有什么特别的原因吗?会容易很多。
标签: maven ant war maven-antrun-plugin