1 package org.codehaus.modello.maven;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 import java.io.File;
26 import java.util.Map;
27
28 import org.apache.maven.plugins.annotations.Mojo;
29 import org.apache.maven.plugins.annotations.Parameter;
30 import org.codehaus.modello.ModelloParameterConstants;
31
32
33
34
35
36
37 @Mojo(name = "xdoc", threadSafe = true)
38 public class ModelloXdocMojo extends AbstractModelloGeneratorMojo {
39
40
41
42 @Parameter(defaultValue = "${project.build.directory}/generated-site/xdoc", required = true)
43 private File outputDirectory;
44
45
46
47
48
49 @Parameter
50 private String xdocFileName;
51
52
53
54
55
56
57
58
59
60 @Parameter
61 private String firstVersion;
62
63 protected String getGeneratorType() {
64 return "xdoc";
65 }
66
67 protected boolean producesCompilableResult() {
68 return false;
69 }
70
71 public File getOutputDirectory() {
72 return outputDirectory;
73 }
74
75 public void setOutputDirectory(File outputDirectory) {
76 this.outputDirectory = outputDirectory;
77 }
78
79 @Override
80 protected void customizeParameters(Map<String, Object> parameters) {
81 super.customizeParameters(parameters);
82
83
84 if (firstVersion == null) {
85 firstVersion = getVersion();
86 }
87
88 parameters.put(ModelloParameterConstants.FIRST_VERSION, firstVersion);
89
90 if (xdocFileName != null) {
91 parameters.put(ModelloParameterConstants.OUTPUT_XDOC_FILE_NAME, xdocFileName);
92 }
93 }
94
95 public String getFirstVersion() {
96 return firstVersion;
97 }
98
99 public void setFirstVersion(String firstVersion) {
100 this.firstVersion = firstVersion;
101 }
102 }