http://www.baeldung.com/maven-minification-of-js-and-css-assets의 지침에 따라 YUI 압축기 maven 플러그인을 Spring MVC 웹 응용 프로그램에 사용하려고합니다. 나는 내 pom.xml
파일에 다음과 같은 추가 :Maven 플러그인을 사용한 CSS 및 JS 파일의 축소가 작동하지 않습니다.
<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>
<nosuffix>true</nosuffix>
<webappDirectory>${project.build.directory}/min</webappDirectory>
<excludes>
<exclude>**/*.min.js</exclude>
<exclude>**/handlebars-3133af2.js</exclude>
<exclude>**/require.js</exclude>
</excludes>
</configuration>
</plugin>
나는 src/main/webapp
아래의 하위 폴더에 많은 CSS와 JS 파일이 있고 설명서에 따라, 이러한 모든 축소 된해야한다. 그러나 maven clean install
을 실행할 때 내 콘솔에서 축소와 관련된 로그를 보지 못하거나 내 war
파일에서 축소 된 파일을 찾지 못합니다.
내가 원하는 모든 기존 CSS 나 JS 파일과 같은 폴더에 같은 파일 이름으로 min
라는 이름의 하위 폴더 아래에있는 축소 된 파일을 저장하는 것입니다
콘솔 로그는 지금 :
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building smartwcm-services 6.3.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ smartwcm-services ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 36 resources
[INFO]
[INFO] --- yuicompressor-maven-plugin:1.5.1:compress (default) @ smartwcm-services ---
[ERROR] E:\projects\smartwcm\source-code\smartwcm-services\src\main\webapp\layout\common\adminv3\ca\css\content\design\azure.js [1:2]: illegal character
[ERROR] ...E:\projects\smartwcm\source-code\smartwcm-services\src\main\webapp\layout\common\adminv3\ca\css\content\design\azure.js:line 1:column 2:illegal character
/* Note: jquery script is assumed to be loaded prior to this script */
[ERROR] E:\projects\smartwcm\source-code\smartwcm-services\src\main\webapp\layout\common\adminv3\ca\css\content\design\azure.js [1:2]: syntax error
[ERROR] ...E:\projects\smartwcm\source-code\smartwcm-services\src\main\webapp\layout\common\adminv3\ca\css\content\design\azure.js:line 1:column 2:syntax error
/* Note: jquery script is assumed to be loaded prior to this script */
[ERROR] E:\projects\smartwcm\source-code\smartwcm-services\src\main\webapp\layout\common\adminv3\ca\css\content\design\azure.js [1:3]: illegal character
[ERROR] ...E:\projects\smartwcm\source-code\smartwcm-services\src\main\webapp\layout\common\adminv3\ca\css\content\design\azure.js:line 1:column 3:illegal character
/* Note: jquery script is assumed to be loaded prior to this script */
[ERROR] E:\projects\smartwcm\source-code\smartwcm-services\src\main\webapp\layout\common\adminv3\ca\css\content\design\azure.js [1:0]: Compilation produced 3 syntax errors.
[ERROR] ...E:\projects\smartwcm\source-code\smartwcm-services\src\main\webapp\layout\common\adminv3\ca\css\content\design\azure.js:line 1:column 0:Compilation produced 3 syntax errors.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.060 s
[INFO] Finished at: 2016-12-29T11:25:32+05:30
[INFO] Final Memory: 19M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:yuicompressor-maven-plugin:1.5.1:compress (default) on project smartwcm-services: Execution default of goal net.alchim31.maven:yuicompressor-maven-plugin:1.5.1:compress failed: Compilation produced 3 syntax errors. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
현재 구성에서 로그에 아무 것도 표시되지 않습니다. –
mvn 콘솔 로그를 게시 할 수 있습니까? 동일한 github 프로젝트를 위해 빌드를 실행하고 있습니까? – abaghel
로그와 업데이트 된 pom.xml 파일로 질문을 업데이트했습니다. –