gpt4 book ai didi

java - minify-maven-plugin cssFinalFile 在哪里?

转载 作者:行者123 更新时间:2023-11-30 10:33:36 24 4
gpt4 key购买 nike

将插件作为默认设置运行。不缩小 js,因为我还不需要它。

在Maven终端获取消息

[INFO] --- minify-maven-plugin:1.7.6:minify (default-minify) @ ac3 ---
[INFO] Starting CSS task:
[INFO] Processing source file [branding.css].
[INFO] Processing source file [custom.css].
[INFO] Processing source file [forms.css].
[INFO] Processing source file [layout.css].
[INFO] Processing source file [style.css].
[INFO] Creating the merged file [style_minified.css].
[INFO] Creating the minified file [style_minified.min.css].
[INFO] Uncompressed size: 116427 bytes.
[INFO] Compressed size: 88816 bytes minified (15739 bytes gzipped).

但我无法在任何地方找到该文件。插件默认将 style_minified.min.css 放在哪里?

这是我的 pom.xml

<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>minify-maven-plugin</artifactId>
<version>1.7.6</version>
<executions>
<execution>
<id>default-minify</id>
<phase>package</phase><!-- When omitted defaults to 'process-resources' -->
<configuration>
<charset>UTF-8</charset>
<cssSourceDir>public/css</cssSourceDir>
<cssSourceFiles>
<cssSourceFile>branding.css</cssSourceFile>
<cssSourceFile>custom.css</cssSourceFile>
<cssSourceFile>forms.css</cssSourceFile>
<cssSourceFile>layout.css</cssSourceFile>
<cssSourceFile>style.css</cssSourceFile>
</cssSourceFiles>
<cssTargetDir>public/css</cssTargetDir>
<cssFinalFile>style_minified.css</cssFinalFile>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
</executions>
</plugin>

我的其他maven进程有这个路径

[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ ac3 ---
[INFO] Packaging webapp
[INFO] Assembling webapp [ac3] in [/root/dev/workspace/AC3/target/ac3]
[INFO] Processing war project
[INFO] Copying webapp resources [/root/dev/workspace/AC3/src/main/webapp]
[INFO] Webapp assembled in [830 msecs]
[INFO] Building war: /root/dev/workspace/AC3/target/ac3.war
[INFO] WEB-INF/web.xml already added, skipping

我的 css 根路径:

/src/main/webapp/public/css

最佳答案

文件生成在target文件夹下。完整的路径是 -

target/<moduleName>-<moduleVersion>/<cssSourceDirSpecified>

e.g. target/minifyCss-2.0.1-SNAPSHOT/public/style_minified.css

附上我名为 minifyCss 的模块(版本为 2.0.1)及其目录的示例屏幕截图。澄清一下,我将使用插件测试的所有资源(基本上是 .css)保存在 webapp/public 文件夹中。

enter image description here

关于java - minify-maven-plugin cssFinalFile 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42119584/

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