1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.sw4j.mojo.apisniffer;
18
19 import java.io.File;
20 import java.io.IOException;
21 import org.apache.maven.plugin.AbstractMojo;
22 import org.apache.maven.plugin.MojoExecutionException;
23 import org.apache.maven.plugin.MojoFailureException;
24 import org.apache.maven.plugins.annotations.Mojo;
25 import org.apache.maven.plugins.annotations.Parameter;
26
27
28
29
30
31 @Mojo(name = "scan")
32 public class ScanApiMojo extends AbstractMojo {
33
34
35
36
37 @Parameter(defaultValue = "${project.build.outputDirectory}", required = true, readonly = true)
38 private File outputDirectory;
39
40 @Override
41 public void execute() throws MojoExecutionException, MojoFailureException {
42 getLog().debug("Executing scan mojo.");
43 try {
44 getLog().debug(new StringBuilder("Scanning directory ")
45 .append(outputDirectory.getCanonicalPath()).toString());
46 } catch (IOException ioex) {
47 getLog().error(new StringBuilder("Determining directory to scan not possible."));
48 throw new MojoExecutionException("Determining directory to scan not possible.", ioex);
49 }
50 }
51
52 }