Allow Closure Compiler errors to fail the build

267 views
Skip to first unread message

Simo Moujami

unread,
Feb 28, 2013, 12:21:02 AM2/28/13
to wr...@googlegroups.com
Hi Alex,
Prior to WRO, we used to used to call closure compiler directly in Maven. In case of JS errors, like trailing commas, closure used to act as a JSLinter and fail the build. 

Now, with WRO errors are shown in the console but the build continues and succeeds. Is there an option we're missing that would force the build to fail?

Log:
 
[INFO] processing group: sales.js
Feb 27, 2013 11:43:29 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /javascript/panels/ProcessCode.js:13: ERROR - Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option.
      '<div class="op-list-row-header"></div>',
      ^
[INFO] file size: sales-f09d9f23.js -> 724856 bytes
[INFO] /projects/merge/trunk/dashboard/web/target/web-4-SNAPSHOT/bundles/js/sales-f09d9f23.js (724856 bytes)

Any ideas?

Thanks,

Alex Objelean

unread,
Feb 28, 2013, 2:13:53 AM2/28/13
to wr...@googlegroups.com

There is a configuration option called ignoreFailingProcessing which is false by default, meaning that any failure during processing should break the build.
What is the value of this option in your wro.properties? If it is false and it still does't behave as expected, please provide more details.

Alex

> --
> You received this message because you are subscribed to the Google Groups "wro4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wro4j+un...@googlegroups.com.
> To post to this group, send email to wr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/wro4j?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

Simo Moujami

unread,
Feb 28, 2013, 7:12:28 PM2/28/13
to wr...@googlegroups.com
Hi Alex, Thanks for the reply. 
Did you mean ignoreFailingProcessor ? It was not explicitely specified in wro.properties since the default is the expected behavior. I also added this option with no success.

wro.properties:

# General Configuration
debug
=true
# Processor Configuration
ignoreFailingProcessor
=false
managerFactoryClassName
=ro.isdc.wro.manager.factory.ConfigurableWroManagerFactory
preProcessors
=cssMin,duplicateAwareCssDataUri,cssUrlRewriting,semicolonAppender,googleClosureSimple
hashStrategy
=MD5
namingStrategy
=hashEncoder-CRC32

maven command log:
MacBook-Pro:web $ mvn -DBUILD_VERSION=2011.1.0.1 -DBUILD_NUMBER=123 wro4j:run -DtargetGroups=base -Dminimize=true
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Dashboard - Web 4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- wro4j-maven-plugin:1.6.2:run (default-cli) @ web ---
[INFO] Executing the mojo: 
[INFO] Wro4j Model path: /projects/merge/trunk/dashboard/web/src/main/webapp/WEB-INF/wro.xml
[INFO] targetGroups: base
[INFO] minimize: true
[INFO] ignoreMissingResources: false
[INFO] destinationFolder: /projects/merge/trunk/dashboard/web/target/wro
[INFO] jsDestinationFolder: /projects/merge/trunk/dashboard/web/target/web-4-SNAPSHOT/bundles/js
[INFO] cssDestinationFolder: /projects/merge/trunk/dashboard/web/target/web-4-SNAPSHOT/bundles/css
[INFO] groupNameMappingFile: null
[INFO] wroManagerFactory class: ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory
[INFO] The following groups will be processed: [base]
[INFO] folder: /projects/merge/trunk/dashboard/web/target/web-4-SNAPSHOT/bundles/css
[INFO] processing group: base.css
0    WARN CssDataUriPreProcessor - [FAIL] extract dataUri from: /resources/css/../images/icon-info.png, because: /projects/merge/trunk/dashboard/web/src/main/webapp/resources/css/../images/icon-info.png (No such file or directory). A possible cause: using CssUrlRewritingProcessor before CssDataUriPreProcessor.
[INFO] file size: base-f2ee40cd.css -> 579095 bytes
[INFO] /projects/merge/trunk/dashboard/web/target/web-4-SNAPSHOT/bundles/css/base-f2ee40cd.css (579095 bytes)
[INFO] folder: /projects/merge/trunk/dashboard/web/target/web-4-SNAPSHOT/bundles/js
[INFO] processing group: base.js
Feb 28, 2013 7:05:14 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: base:49990: ERROR - Parse error. missing ; before statement
X    var view;
     ^

[INFO] file size: base-b8450364.js -> 3053022 bytes
[INFO] /projects/merge/trunk/dashboard/web/target/web-4-SNAPSHOT/bundles/js/base-b8450364.js (3053022 bytes)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.415s
[INFO] Finished at: Thu Feb 28 19:05:15 EST 2013
[INFO] Final Memory: 21M/422M
[INFO] ------------------------------------------------------------------------



Alex Objelean

unread,
Feb 28, 2013, 7:15:49 PM2/28/13
to wr...@googlegroups.com

Might be a bug. Will take a look tomorrow.

Alex

Alex Objelean

unread,
Mar 1, 2013, 7:26:32 AM3/1/13
to wr...@googlegroups.com
I can now confirm that this is a bug. I'll open an issue and will fix it for next release.

Cheers, 
Alex


On Friday, 1 March 2013 02:15:49 UTC+2, Alex Objelean wrote:

Might be a bug. Will take a look tomorrow.

Alexa

To unsubscribe from this group and stop receiving emails from it, send an email to wro4j+unsubscribe@googlegroups.com.

Simo Moujami

unread,
Mar 1, 2013, 7:15:51 PM3/1/13
to wr...@googlegroups.com
Thank you. Looking forward to the next release.
To unsubscribe from this group and stop receiving emails from it, send an email to wro4j+un...@googlegroups.com.

deepa...@gmail.com

unread,
Nov 29, 2017, 6:02:41 AM11/29/17
to wro4j
Any update on this??
Reply all
Reply to author
Forward
0 new messages