国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

java - yuicompressor-maven-plugin 合并可用卻不壓縮, 哪配置不對?

瀏覽:127日期:2024-02-09 18:42:53

問題描述

想在構建時自動壓縮和合并指定的 js 文件,免得每次改了后手動壓縮,但是輸出的文件卻沒有壓縮、混淆代碼,試過把 aggregations 去掉但什么也沒發生,輸出如果指向 ${project.build.directory}/${project.build.finalName} 下面則在清理后會報找不到文件,即使 phase 改成 prepare-package 也不行。有一點猜測可能引起問題的地方在于我的 webapp 目錄是特別配置的,不是默認位置,但試了設置 sourceDirectory 和 outputDirecotry 無效。pom.xml 中配置如下:

<plugin> <groupId>net.alchim31.maven</groupId> <artifactId>yuicompressor-maven-plugin</artifactId> <version>1.5.1</version> <executions><execution> <goals><goal>compress</goal> </goals></execution> </executions> <configuration><encoding>UTF-8</encoding><jswarn>false</jswarn><suffix>.min</suffix><excludes> <exclude>**/*.min.*</exclude> <exclude>**/*-min.*</exclude></excludes><aggregations> <aggregation><output>${basedir}/web/static/assets/hongscore.js</output><inputDir>${basedir}/web/static/assets/src</inputDir><includes> <include>hongscore.js</include> <include>hongscore-form.js</include> <include>hongscore-list.js</include> <include>hongscore-tree.js</include> <include>hongscore-fork.js</include> <include>hongscore-file.js</include> <include>hongscore-date.js</include></includes><removeIncluded>false</removeIncluded><insertNewLine>true</insertNewLine> </aggregation></aggregations> </configuration></plugin>

問題解答

回答1:

我靠,果然,配置 warSourceDirectory 指向修改過的 webapp 目錄就搞定了,在寫下問題時才想起該試試的,還以為只要在 war 打包里配置好了其他地方就都能正常識別了。

標簽: java
主站蜘蛛池模板: 宁南县| 陈巴尔虎旗| 大田县| 通州市| 克什克腾旗| 新晃| 东台市| 松滋市| 祥云县| 彭山县| 衡阳市| 枞阳县| 桃园县| 武汉市| 巩留县| 清徐县| 蕉岭县| 商水县| 东明县| 北安市| 巴彦淖尔市| 长治市| 延庆县| 美姑县| 方城县| 宁津县| 兴隆县| 绵阳市| 乐陵市| 南汇区| 罗江县| 阿图什市| 郴州市| 兴宁市| 马关县| 旬阳县| 江北区| 苍南县| 巴南区| 石城县| 湖州市|