Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7911653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:19:42+00:00 2026-06-03T13:19:42+00:00

We compress our javascript (and css files) with YUI compressor during our ant build

  • 0

We compress our javascript (and css files) with YUI compressor during our ant build task running on our Jenkins CI Server. However, it is very difficult to determine which js files YUI compressor is having errors with. We see a bunch of things like:

[minify-js] [ERROR] 3:35:unterminated string literal
[minify-js] 
[minify-js] [ERROR] 3:35:syntax error
[minify-js] 
[minify-js] [ERROR] 4:8:syntax error
[minify-js] 
[minify-js] [ERROR] 1:0:Compilation produced 3 syntax errors.
[minify-js] org.mozilla.javascript.EvaluatorException: Compilation produced 3 syntax errors.
[minify-js]     at com.yahoo.platform.yui.compressor.YUICompressor$1.runtimeError(YUICompressor.java:135)
[minify-js]     at org.mozilla.javascript.Parser.parse(Parser.java:410)
[minify-js]     at org.mozilla.javascript.Parser.parse(Parser.java:355)
[minify-js]     at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
[minify-js]     at com.yahoo.platform.yui.compressor.JavaScriptCompressor.(JavaScriptCompressor.java:533)
[minify-js]     at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:112)
[minify-js]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[minify-js]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[minify-js]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[minify-js]     at java.lang.reflect.Method.invoke(Method.java:616)
[minify-js]     at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:20)
[minify-js] Result: 2

in the output, but I have no idea which of the hundreds of JS files the error is coming from. Our ant task looks like:

<target name="minify-js">
    <apply executable="yuicompressor" parallel="false" dest="${global.dir}/" taskname="minify-js" force="true">
        <fileset dir="${global.dir}/" includes="**/*.js">
            <exclude name="*.min.js" />
        </fileset>
        <arg value="--type=js" />
        <srcfile />
        <arg value="-o" />
        <targetfile />
        <mapper type="identity" />
    </apply>
</target>

Not being an expert on Ant or YUI compressor, is there something we can do so that the filename where there error is happening is output somewhere?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:19:44+00:00Added an answer on June 3, 2026 at 1:19 pm

    I don’t know how the yuicompressor works, I assume that it works on one file at a time.

    If this is true, you can do it with for from ant-contrib. You would need to install ant-contrib prior.

    <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${global.dir}/bin_data/ant-contrib-0.6.jar"/>
    <for param="file">
      <path>
        <fileset dir="${global.dir}/" includes="**/*.js">
          <exclude name="*.min.js" />
        </fileset>
      </path>
      <sequential>
        <echo>youcompressor for @{file}</echo> <!-- Will output each file and help debugging -->
        <exec executable="yuicompressor"> <!-- I took the args from the official documentation-->
          <arg value="--type=js" />
          <arg value="-o" />
          <arg value="'.js$:-min.js'" />
          <arg value="@{file}" />
        </exec>
      </sequential>
    </for>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using YUI Compressor to minify Javascript files. However these Javascript files contains
we're looking to compress our gargantuan JavaScript files with GZip to speed up the
I want to use YUI Compressor to combine and compress my css and js
I'm merging (and afterwards minify with YUI compressor) my CSS and JS files. My
I want to compress javascript in yui compressor, How to write Make file for
My site uses YUI Compressor to minify CSS and it's removing the space preceding
I have used Yahoo YUI Compressor for .net to minify my css and js
We have a project where the .js and .css files gets compressed with YUI
Just like javascript compressor, i use the same technique for css. First, i merge
What compressor is the best for javascript and css minified ? I am using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.