gpt4 book ai didi

java - 我正在尝试使用 wro4j Maven 在构建时压缩 js 和 css 文件

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:02:42 24 4
gpt4 key购买 nike

<分区>

我正在尝试使用 wro4j Maven(通过 m2e-wtp 调用 - 使用 Eclipse Luna)在构建时对 js 和 css 文件进行 gzip 压缩,但它不起作用。我尝试过 1.7.51.7.7 版本。

下面是我的配置:

wro.xml:

<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<executions>
<!-- JS minification -->
<execution>
<id>js-minify</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<debug>true</debug>
<targetGroups>angular-deps,app-bundle</targetGroups>
<minimize>true</minimize>
<!-- provide Google Closure compiler options using custom factory --><wroManagerFactory>com.manikanta.wro4j.maven.CustomWroManagerFactory</wroManagerFactory>
<groupNameMappingFile>${basedir}/src/main/webapp/js-min/group-mapping.properties</groupNameMappingFile>
<ignoreMissingResources>false</ignoreMissingResources>
<gzipEnabled>true</gzipEnabled>
</configuration>
</execution>

<!-- CSS minification -->
<execution>
<id>css-minify</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<targetGroups>styles</targetGroups>
<minimize>true</minimize>
<ignoreMissingResources>true</ignoreMissingResources>
<groupNameMappingFile>${basedir}/src/main/webapp/css-min/group-mapping.properties</groupNameMappingFile>
</configuration>
</execution>
</executions>

<configuration>
<contextFolder>${basedir}/src/main/webapp/</contextFolder>
<!-- <destinationFolder>${project.build.directory}/${project.build.finalName}</destinationFolder> -->
<destinationFolder>${basedir}/src/main/webapp/bundle</destinationFolder>
<jsDestinationFolder>${basedir}/src/main/webapp/js-min</jsDestinationFolder>
<cssDestinationFolder>${basedir}/src/main/webapp/css-min</cssDestinationFolder>
<wroFile>${basedir}/src/main/resources/wro.xml</wroFile>
<extraConfigFile>${basedir}/src/main/resources/wro.properties</extraConfigFile>
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
<ignoreMissingResources>false</ignoreMissingResources>
<incrementalBuildEnabled>true</incrementalBuildEnabled>
</configuration>
</plugin>

wro.properties:

# General Configuration
debug=true

gzipResources=true
gzipEnabled=true

#List of preProcessors
preProcessors=googleClosureSimple
#List of postProcessors
postProcessors=yuiCssMin

# naming strategy
hashStrategy=CRC32
namingStrategy=hashEncoder

sourceMapsDestinationFolder=d:/__sourcemaps

incrementalBuildEnabled=true

parallelPreprocessing=true
parallelProcessing=true

我尝试了 gzipResourcesgzipEnabled(不清楚哪一次用于构建时解决方案!)。

有人能告诉我如何在构建时进行 gzip 压缩吗?谢谢。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com