From: Leif Åstrand Date: Thu, 11 Oct 2012 15:17:41 +0000 (+0300) Subject: Only ignore NoClassDefFoundError if SmartSprites is missing (#9943) X-Git-Tag: 7.0.0.beta6~50 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2b0d4893c803c38159462cb4f815dcf33feed1d0;p=vaadin-framework.git Only ignore NoClassDefFoundError if SmartSprites is missing (#9943) Change-Id: I50f33a3bbd648555bc59b8591bc84f8723a4eff4 --- diff --git a/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java b/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java index 90e3faf10e..47c519d09e 100644 --- a/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java +++ b/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java @@ -105,19 +105,22 @@ public class CompileTheme { private static void createSprites(String themeFolder, String themeName) throws FileNotFoundException, IOException { try { - String[] parameters = new String[] { "--sprite-png-depth", "AUTO", - "--css-file-suffix", "-sprite", "--css-file-encoding", - "UTF-8", "--root-dir-path", - themeFolder + File.separator + themeName, "--log-level", - "WARN" }; - - org.carrot2.labs.smartsprites.SmartSprites.main(parameters); - System.out.println("Generated sprites"); - + // Try loading the class separately from using it to avoid + // hiding other classpath issues + Class smartSpritesClass = org.carrot2.labs.smartsprites.SmartSprites.class; } catch (NoClassDefFoundError e) { System.err .println("Could not find smartsprites. No sprites were generated. The theme should still work."); + return; } + String[] parameters = new String[] { "--sprite-png-depth", "AUTO", + "--css-file-suffix", "-sprite", "--css-file-encoding", "UTF-8", + "--root-dir-path", themeFolder + File.separator + themeName, + "--log-level", "WARN" }; + + org.carrot2.labs.smartsprites.SmartSprites.main(parameters); + System.out.println("Generated sprites"); + } }