maven yui压缩打war包后,js文件不见了

我用maven yui压缩打包
<!-- YUI Compressor Maven压缩插件 -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.3.0</version>
<executions>
<execution>
<id>yuicompressor</id>
<phase>prepare-package</phase>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- 压缩文件编码 -->
<encoding>UTF-8</encoding>
<!-- 不显示js可能的错误 -->
<jswarn>false</jswarn>
<!-- 若存在已压缩的文件,会先对比源文件是否有改动,有改动便压缩,无改动就不压缩 -->
<force>false</force>
<!-- 把文件压缩成一行 -->
<linebreakpos>-1</linebreakpos>
<!-- 没有文件后缀 -->
<nosuffix>true</nosuffix>
<!-- 要压缩的js和css文件 -->
<includes>
<include>**/*.js</include>
<include>**/*.css</include>
</includes>
<!-- 不会压缩的js和css文件,排除已经压缩的文件,比如jquery.min.js -->
<excludes>
<exclude>**/*.min.css</exclude>
<exclude>**/*-min.css</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*-min.js</exclude>
<exclude>F2E/**/*.js</exclude>
<exclude>F2E/**/*.css</exclude>
<exclude>page/**/*.js</exclude>
<exclude>page/**/*.css</exclude>
<exclude>resource/aijs/**/*.js</exclude>
<exclude>**/angular.js</exclude>
<exclude>**/angular-*.js</exclude>
<exclude>**/server.js</exclude>
<exclude>**/require.js</exclude>
</excludes>
<!-- 指定需要压缩文件的目录 -->
<sourceDirectory>src/main/webapp</sourceDirectory>
<!-- 压缩后输出文件目录 -->
<outputDirectory>${basedir}/target</outputDirectory>
</configuration>

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<warSourceExcludes>**/*.js,**/*.css</warSourceExcludes>

结果打war包后,发现<excludes>里包含的,也就是不被压缩的文件,在war包里直接没了,这个怎么解决

第1个回答  2014-11-25
<warSourceExcludes>**/*.js,**/*.css</warSourceExcludes>
你这里写的不是要排除Js、css文件打war包的吗?本回答被网友采纳
相似回答