java - failed to compress javascript files using yuicompressor -


i have ant file contains task compress js files. using yui compressor compress files. have defined taskdef

<taskdef resource="yuicompressor.tasks" classpath="lib/yuicompressor-taskdef-1.0.jar;lib/yuicompressor-2.4.2.jar" /> 

and how using yui compressor ant task

<yuicompressor todir="./js/" verbose="true">     <fileset dir="./js/"          includes="**/*.js">      </fileset>     <mapper type="glob" from="*.js" to="*.js" /> </yuicompressor> 

when run ant file directly works fine, js files compressed.

but when run ant file pom.xml shows

failed compress files file_name.js 

this execution task in pom.xml

<execution>     <id>default</id>     <phase>generate-sources</phase>     <configuration>         <tasks>             <tstamp />             <ant antfile="build.xml" />         </tasks>     </configuration>     <goals>         <goal>run</goal>     </goals> </execution> 

what possible issue?

in case using relative path in yuicompressor

<yuicompressor todir="./js/" verbose="true">     <fileset dir="./js/"          includes="**/*.js">      </fileset>     <mapper type="glob" from="*.js" to="*.js" /> </yuicompressor> 

i updated

<yuicompressor todir="${basedir}/js/" verbose="true">     <fileset dir="${basedir}/js/"          includes="**/*.js">      </fileset>     <mapper type="glob" from="*.js" to="*.js" /> </yuicompressor> 

and working fine!!


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -