YUI Compressor Maven Mojo 不压缩包 war:war 的文件
YUI Compressor Maven Mojo doesn't compress files for package war:war
我只想在将项目打包到 war 文件时压缩我的文件。我对 Maven 有点陌生,这是我尝试使用的第一个打包插件。
我遵循了 http://alchim.sourceforge.net/yuicompressor-maven-plugin/plugin-info.html 的说明以及关于此插件的一些其他问题:
我的构建部分只有基础知识:
<build>
<sourceDirectory>src</sourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
(...)
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
(...)
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
<configuration>
<nosuffix>true</nosuffix>
</configuration>
</plugin>
</plugins>
</build>
但是当我尝试 'mvn package war:war' 它不压缩任何东西:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building FCO-novo-layout 0.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ FCO-novo-layout ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ FCO-novo-layout ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ FCO-novo-layout ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ FCO-novo-layout ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ FCO-novo-layout ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.6:war (default-war) @ FCO-novo-layout ---
[INFO] Packaging webapp
[INFO] Assembling webapp [FCO-novo-layout] in [C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\target\FCO-novo-layout-0.0.2-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\WebContent]
[INFO] Webapp assembled in [379 msecs]
[INFO] Building war: C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\target\FCO-novo-layout-0.0.2-SNAPSHOT.war
[INFO]
##########################################################################
##########################################################################
[INFO] --- yuicompressor-maven-plugin:1.1:compress (default) @ FCO-novo-layout ---
[INFO] nb warnings: 0, nb errors: 0
[INFO]
[INFO] --- maven-war-plugin:2.6:war (default-cli) @ FCO-novo-layout ---
[INFO] Packaging webapp
[INFO] Assembling webapp [FCO-novo-layout] in [C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\target\FCO-novo-layout-0.0.2-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\WebContent]
[INFO] Webapp assembled in [969 msecs]
[INFO] Building war: C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\target\FCO-novo-layout-0.0.2-SNAPSHOT.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.472 s
[INFO] Finished at: 2016-08-11T11:53:58-03:00
[INFO] Final Memory: 15M/217M
[INFO] ------------------------------------------------------------------------
运行 mvn net.alchim31.maven:yuicompressor-maven-plugin:compress 你的 maven pom 目录怎么样?
我只想在将项目打包到 war 文件时压缩我的文件。我对 Maven 有点陌生,这是我尝试使用的第一个打包插件。
我遵循了 http://alchim.sourceforge.net/yuicompressor-maven-plugin/plugin-info.html 的说明以及关于此插件的一些其他问题:
我的构建部分只有基础知识:
<build>
<sourceDirectory>src</sourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
(...)
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
(...)
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
<configuration>
<nosuffix>true</nosuffix>
</configuration>
</plugin>
</plugins>
</build>
但是当我尝试 'mvn package war:war' 它不压缩任何东西:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building FCO-novo-layout 0.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ FCO-novo-layout ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ FCO-novo-layout ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ FCO-novo-layout ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ FCO-novo-layout ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ FCO-novo-layout ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.6:war (default-war) @ FCO-novo-layout ---
[INFO] Packaging webapp
[INFO] Assembling webapp [FCO-novo-layout] in [C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\target\FCO-novo-layout-0.0.2-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\WebContent]
[INFO] Webapp assembled in [379 msecs]
[INFO] Building war: C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\target\FCO-novo-layout-0.0.2-SNAPSHOT.war
[INFO]
##########################################################################
##########################################################################
[INFO] --- yuicompressor-maven-plugin:1.1:compress (default) @ FCO-novo-layout ---
[INFO] nb warnings: 0, nb errors: 0
[INFO]
[INFO] --- maven-war-plugin:2.6:war (default-cli) @ FCO-novo-layout ---
[INFO] Packaging webapp
[INFO] Assembling webapp [FCO-novo-layout] in [C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\target\FCO-novo-layout-0.0.2-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\WebContent]
[INFO] Webapp assembled in [969 msecs]
[INFO] Building war: C:\web_prj\ECL_WKSPC_64_MARS_7.17_before_intl_removal\FCO-novo-layout\target\FCO-novo-layout-0.0.2-SNAPSHOT.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.472 s
[INFO] Finished at: 2016-08-11T11:53:58-03:00
[INFO] Final Memory: 15M/217M
[INFO] ------------------------------------------------------------------------
运行 mvn net.alchim31.maven:yuicompressor-maven-plugin:compress 你的 maven pom 目录怎么样?