2012-03-30 5 views
2

집계 파일을 포함하는 "sources"디렉토리를 제외하고 집계 파일을 압축하려고하므로 집계 후에 압축 파일 용 Maven YUI Compressor를 설정할 수 있습니까?Maven YUI Compressor : 집계 후 압축

예를 들어 나는 /JS/소스/MYLIB/ 내부 일부의 .js-파일이이 모든 파일은 동안 유이 압축기 집계 단계 /js/mylib.js에게 하나 개의 파일에을 합병했다. pom.xml에서 나는 전체 /js/sources/을 제외하고 파일을 /js 라이브러리에서만 압축하도록 yui-compressor를 구성하지만 yui-compressor는 집계 전에 "compress"목표를 실행하므로 병합 된 파일을 압축 해제했습니다. 그리고 어떻게 든이 문제를 해결할 필요가 있습니다.

+0

마지막으로 @SquAreRoot에 대한 해결책을 찾았습니까? – Patrick

답변

1

다음과 같이 말할 수 있습니다. 압축 후 집계 할 수 있습니까? 그렇다면, 나는 똑같은 문제가 있었고, 다음과 같이 나와 함께 해결했습니다.

트릭은 출력 파일을 원본이 아닌 대상 dir에 넣는 것처럼 보였습니다. 그렇게하면 집계에서 축소 된 파일을 포함 할 수 있습니다.

이미 압축 된 파일 나는 basedir var.

<executions> 
    <execution> 
     <goals> 
     <goal>compress</goal> 
     </goals> 
    </execution> 
    </executions>   
    <configuration> 
    <excludes> 
     <exclude>**/*-min.js</exclude> 
     <exclude>**/*.min.js</exclude> 
     <exclude>**/*.css</exclude> 
    </excludes> 
    <removeIncluded>false</removeIncluded> 
    <jswarn>false</jswarn> 
    <aggregations> 
     <aggregation> 
      <insertNewLine>true</insertNewLine> 
      <removeIncluded>false</removeIncluded> 
      <includes> 
       <!-- these exist only in target dir. the original was json2.js & bootstrap.tabs.js --> 
       <include>**/bootstrap-tabs-min.js</include> 
       <include>**/json2-min.js</include> 
       <!-- use originals for the ones already minified --> 
       <include>${basedir}/src/main/webapp/js/backbone-min.js</include> 
      </includes> 
      <output>${project.build.directory}/${project.build.finalName}/js/test.js</output> 
     </aggregation> 
    </aggregations> 
    </configuration> 
+0

글쎄,이 경우에는 원래의 미완료 파일이 없지만 프로덕션에서의 문제 해결을 단순화하기 위해 "개발자"사용자 그룹을 위해이 파일을 추가로 유지하고자합니다. 하지만, 글쎄, 난 그냥 에 의해 소스 루트에서 Maven의 작업에 의해 unimified 파일을 복사 할 수 있다고 생각합니다 – SquAreRoot

+0

거짓 나는 원본이 보관되어 있는지 확인합니다 생각합니다. BTW, 위의 다른 기괴한 문제가있는 것처럼이 플러그인을 현재 체크 아웃하고 있습니다 : http://maven-samaxes-plugin.googlecode.com/svn/sites/maven-minify-plugin/minify-mojo. HTML – demiurg

관련 문제