1
2
3
4
5
6
7 package net.alchim31.maven.yuicompressor;
8
9 import java.io.IOException;
10
11 import org.apache.maven.plugins.annotations.LifecyclePhase;
12 import org.apache.maven.plugins.annotations.Mojo;
13
14
15
16
17 @Mojo(name = "jslint", defaultPhase = LifecyclePhase.PROCESS_RESOURCES, requiresProject = true, threadSafe = true)
18 public class JSLintMojo extends MojoSupport {
19
20
21 private JSLintChecker jslint;
22
23 @Override
24 protected String[] getDefaultIncludes() {
25 return new String[] { "**/**.js" };
26 }
27
28 @Override
29 public void beforeProcess() throws IOException {
30 jslint = new JSLintChecker();
31 }
32
33 @Override
34 public void afterProcess() {
35
36 }
37
38 @Override
39 protected void processFile(SourceFile src) throws IOException {
40 getLog().info("check file :" + src.toFile());
41 jslint.check(src.toFile(), jsErrorReporter);
42 }
43 }