@Test public void testCustomArguments() throws MojoFailureException, MojoExecutionException, IOException { cleanup(); less.execute(); mojo.cleanCssArguments = "--debug -c ie7 -b"; mojo.execute(); File site = new File(FAKE_PROJECT_TARGET, "classes/assets/css/site-min.css"); assertThat(site).isFile(); assertThat(FileUtils.readFileToString(site)) .contains("h1{color:red}"); File style = new File(FAKE_PROJECT_TARGET, "classes/assets/less/style-min.css"); assertThat(style).isFile(); assertThat(FileUtils.readLines(style)).hasSize(2); }
@Override public void execute() throws MojoExecutionException { if (skipCleanCSS) { getLog().debug("Skipping CSS minification"); removeFromWatching(); return; } cleancss = NPM.npm(this, CLEANCSS_NPM_NAME, cleanCssVersion); getLog().info("Clean CSS version: " + cleanCssVersion); if (stylesheets == null) { getLog().info("No 'stylesheets' processing configuration, minifying all '.css' files individually"); for (File file : getResources(getExtensions())) { try { process(file); } catch (WatchingException e) { throw new MojoExecutionException(e.getMessage(), e); } } } else { process(stylesheets); } }
CSSMinifierMojo extends AbstractWisdomWatcherMojo { @Override public void execute() throws MojoExecutionException { if (skipCleanCSS) { getLog().debug("Skipping CSS minification"); removeFromWatching(); return; } cleancss = NPM.npm(this, CLEANCSS_NPM_NAME, cleanCssVersion); getLog().info("Clean CSS version: " + cleanCssVersion); if (stylesheets == null) { getLog().info("No 'stylesheets' processing configuration, minifying all '.css' files individually"); for (File file : getResources(getExtensions())) { try { process(file); } catch (WatchingException e) { throw new MojoExecutionException(e.getMessage(), e); } } } else { process(stylesheets); } } }
CSSMinifierMojo extends AbstractWisdomWatcherMojo { @Override public void execute() throws MojoExecutionException { if (skipCleanCSS) { getLog().debug("Skipping CSS minification"); removeFromWatching(); return; } cleancss = NPM.npm(this, CLEANCSS_NPM_NAME, cleanCssVersion); getLog().info("Clean CSS version: " + cleanCssVersion); if (stylesheets == null) { getLog().info("No 'stylesheets' processing configuration, minifying all '.css' files individually"); for (File file : getResources(getExtensions())) { try { process(file); } catch (WatchingException e) { throw new MojoExecutionException(e.getMessage(), e); } } } else { process(stylesheets); } }  }
CSSMinifierMojo extends AbstractWisdomWatcherMojo { @Override public void execute() throws MojoExecutionException { if (skipCleanCSS) { getLog().debug("Skipping CSS minification"); removeFromWatching(); return; } cleancss = NPM.npm(this, CLEANCSS_NPM_NAME, cleanCssVersion); getLog().info("Clean CSS version: " + cleanCssVersion); if (stylesheets == null) { getLog().info("No 'stylesheets' processing configuration, minifying all '.css' files individually"); for (File file : getResources(getExtensions())) { try { process(file); } catch (WatchingException e) { throw new MojoExecutionException(e.getMessage(), e); } } } else { process(stylesheets); } }  @Override void execute(); @Override boolean accept(File file); boolean isNotMinified(File file); @Override boolean fileCreated(File file); @Override boolean fileUpdated(File file); @Override boolean fileDeleted(File file); File getFilteredVersion(File input); }
CSSMinifierMojo extends AbstractWisdomWatcherMojo { @Override public void execute() throws MojoExecutionException { if (skipCleanCSS) { getLog().debug("Skipping CSS minification"); removeFromWatching(); return; } cleancss = NPM.npm(this, CLEANCSS_NPM_NAME, cleanCssVersion); getLog().info("Clean CSS version: " + cleanCssVersion); if (stylesheets == null) { getLog().info("No 'stylesheets' processing configuration, minifying all '.css' files individually"); for (File file : getResources(getExtensions())) { try { process(file); } catch (WatchingException e) { throw new MojoExecutionException(e.getMessage(), e); } } } else { process(stylesheets); } }  @Override void execute(); @Override boolean accept(File file); boolean isNotMinified(File file); @Override boolean fileCreated(File file); @Override boolean fileUpdated(File file); @Override boolean fileDeleted(File file); File getFilteredVersion(File input); static final String CLEANCSS_NPM_NAME; static final String CLEANCSS_NPM_VERSION; @Parameter(defaultValue = "${skipCleanCSS}")
    public boolean skipCleanCSS; @Parameter(defaultValue = "-min")
    public String cssMinifierSuffix; }