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