Maven ant-war插件试图排除文件夹
嗨,我正在使用ant-war插件,并试图从teh-war中排除一个文件夹。然而,这并没有被排除在外 结构如下Maven ant-war插件试图排除文件夹,maven,ant,war,maven-antrun-plugin,Maven,Ant,War,Maven Antrun Plugin,嗨,我正在使用ant-war插件,并试图从teh-war中排除一个文件夹。然而,这并没有被排除在外 结构如下 XYZ src main webapp web-inf web.xml common api a
XYZ
src
main
webapp
web-inf
web.xml
common
api
a.js
b.js
我的target=production的build.xml如下所示,我正在尝试排除公共文件夹。然而,我看到它根本没有排除它
<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>
${workingDirectory}”/>
在我的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>
maven antrun插件
生产
包裹
跑
如何在war文件中排除这些js文件?对于生产模式。我计划排除这些js文件并包括一个缩小的js文件。任何指针都包括
中的
:
在
中包含
:
当您使用basedir
属性时,直接添加到未嵌套到文件集中的任务中的exclude
适用于隐式文件集
任务表单。如果没有任何basedir
属性,则不会执行任何操作。这可能不会在war
文档中提及,但在ide打开链接的jar
页面
您必须将exclude
放在文件集
中,该文件集可以拉入您不需要的文件。lib
和类
是具有不同名称的文件集
(它们实际上只是带有硬编码前缀
属性的zipfileset
).当您使用basedir
属性时,直接添加到未嵌套到文件集中的任务中的exclude
将应用于隐式文件集
任务表单。如果没有任何basedir
属性,则不会执行任何操作。这可能不会在war
文档中提及,但在e链接的jar
页面
您必须将exclude
放在文件集
中,该文件集可以拉入您不需要的文件。lib
和类
是具有不同名称的文件集
(它们实际上只是带有硬编码前缀
属性的zipfileset
).您不使用maven-war插件有什么特别的原因吗?这会容易得多。您不使用maven-war插件有什么特别的原因吗?这会容易得多。
<fileset dir="${webappsrc}">
<exclude name="common/api/*.js" />
</fileset>