作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
将插件作为默认设置运行。不缩小 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
文件夹中。
关于java - minify-maven-plugin cssFinalFile 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42119584/
将插件作为默认设置运行。不缩小 js,因为我还不需要它。 在Maven终端获取消息 [INFO] --- minify-maven-plugin:1.7.6:minify (default-minif
我是一名优秀的程序员,十分优秀!