maven编译拷贝二进制文件大小不一致

 

 <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <outputDirectory>${basedir}/../target</outputDirectory>
                    <webResources>
                        <resource>
                            <directory>${basedir}/src/main/webapp</directory>
                            <filtering>true</filtering>
                            <includes>
                                <include>*</include>
                            </includes>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>

 webapp下面有个uploadify.swf文件,在linux上maven编译打包以后大小和windows上的不一致。

 

  解决办法就是就是将

 <filtering>true</filtering> 改为 false

 

 <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <outputDirectory>${basedir}/../target</outputDirectory>
                    <webResources>
                        <resource>
                            <directory>${basedir}/src/main/webapp</directory>
                            <filtering>false</filtering>
                            <includes>
                                <include>*</include>
                            </includes>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>

 

Warning: Do not filter files with binary content like images! This will most likely result in corrupt output. If you have both text files and binary files as resources, you need to declare two mutually exclusive resource sets. The first resource set defines the files to be filtered and the other resource set defines the files to copy unaltered as illustrated below:

<project>
  ...
  <build>
    ...
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/*.xml</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>false</filtering>
        <excludes>
          <exclude>**/*.xml</exclude>
        </excludes>
      </resource>
      ...
    </resources>
    ...
  </build>
  ...
</project>

 

你可能感兴趣的:(maven)