wro4j maven插件附加文件内容而不是替换

时间:2016-04-25 13:50:08

标签: java maven spring-mvc wro4j

我对maven的wro4j插件有问题。当我正在部署应用程序并执行插件以最小化和捆绑我的资源文件时,它会将新内容附加到all.css和all.js文件,而不是替换它们的内容。如果在它之前没有完成清理,这是非常麻烦的。我想知道,是否有可能以某种方式配置它?

我的配置如下:

的web.xml

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

    <error-page>
        <exception-type>org.springframework.security.web.authentication.rememberme.CookieTheftException</exception-type>
        <location>/login</location>
    </error-page>

    <filter>
        <filter-name>CorsFilter</filter-name>
        <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
        <init-param>
            <param-name>cors.allowed.origins</param-name>
            <param-value>*</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>CorsFilter</filter-name>
        <url-pattern>/resources/*</url-pattern>
   </filter-mapping>

</web-app>

wro.xml

<groups xmlns="http://www.isdc.ro/wro"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.isdc.ro/wro">
    <group name="all">
        <js>/resources/js/jquery*.js</js>
        <js>/resources/js/bootstrap.min.js</js>
        <js>/resources/js/bootstrap-*.js</js>
        <js>/resources/js/**.js</js>
        <css>/resources/css/bootstrap.min.css</css>
        <css>/resources/css/sunbasket-web.css</css>
        <css>/resources/css/bootstrap-*.css</css>
        <css>/resources/css/**.css</css>
   </group>
</groups>

的pom.xml

<plugin>
    <groupId>ro.isdc.wro4j</groupId>
    <artifactId>wro4j-maven-plugin</artifactId>
    <version>1.8.0</version>
    <executions>
        <execution>
            <phase>compile</phase>
            <goals>
                <goal>run</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <targetGroups>all</targetGroups>
        <cssDestinationFolder>${project.basedir}/src/main/webapp/resources/css/</cssDestinationFolder>
        <jsDestinationFolder>${project.basedir}/src/main/webapp/resources/js/</jsDestinationFolder>          
        <contextFolder>${project.basedir}/src/main/webapp/</contextFolder>
        <wroFile>${project.basedir}/src/main/webapp/WEB-INF/wro.xml</wroFile>
        <extraConfigFile>${project.basedir}/src/main/resources/wro.properties</extraConfigFile>
        <ignoreMissingResources>false</ignoreMissingResources>
    </configuration>
</plugin>

0 个答案:

没有答案