1 package org.apache.maven.plugins.site;
2
3 import java.util.ArrayList;
4 import java.util.Iterator;
5 import java.util.List;
6
7 import org.apache.maven.plugin.AbstractMojo;
8 import org.apache.maven.plugin.MojoExecutionException;
9
10
11
12
13
14
15
16
17
18
19 public class HelpMojo
20 extends AbstractMojo
21 {
22
23
24
25
26
27 private boolean detail;
28
29
30
31
32
33
34 private java.lang.String goal;
35
36
37
38
39
40
41 private int lineLength;
42
43
44
45
46
47
48 private int indentSize;
49
50
51
52 public void execute()
53 throws MojoExecutionException
54 {
55 if ( lineLength <= 0 )
56 {
57 getLog().warn( "The parameter 'lineLength' should be positive, using '80' as default." );
58 lineLength = 80;
59 }
60 if ( indentSize <= 0 )
61 {
62 getLog().warn( "The parameter 'indentSize' should be positive, using '2' as default." );
63 indentSize = 2;
64 }
65
66 StringBuffer sb = new StringBuffer();
67
68 append( sb, "org.apache.maven.plugins:maven-site-plugin:3.0", 0 );
69 append( sb, "", 0 );
70
71 append( sb, "Maven Site Plugin 3", 0 );
72 append( sb, "The Maven Site Plugin is a plugin that generates a site for the current project.", 1 );
73 append( sb, "", 0 );
74
75 if ( goal == null || goal.length() <= 0 )
76 {
77 append( sb, "This plugin has 9 goals:", 0 );
78 append( sb, "", 0 );
79 }
80
81 if ( goal == null || goal.length() <= 0 || "attach-descriptor".equals( goal ) )
82 {
83 append( sb, "site:attach-descriptor", 0 );
84 append( sb, "Adds the site descriptor (site.xml) to the list of files to be installed/deployed. By default, this is enabled only when the project has pom packaging since it will be used by modules inheriting, but this can be enabled for other projects packaging if needed.", 1 );
85 append( sb, "", 0 );
86 if ( detail )
87 {
88 append( sb, "Available parameters:", 1 );
89 append( sb, "", 0 );
90
91 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
92 append( sb, "Specifies the input encoding.", 3 );
93 append( sb, "Expression: ${encoding}", 3 );
94 append( sb, "", 0 );
95
96 append( sb, "locales", 2 );
97 append( sb, "A comma separated list of locales supported by Maven. The first valid token will be the default Locale for this instance of the Java Virtual Machine.", 3 );
98 append( sb, "Expression: ${locales}", 3 );
99 append( sb, "", 0 );
100
101 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
102 append( sb, "Specifies the output encoding.", 3 );
103 append( sb, "Expression: ${outputEncoding}", 3 );
104 append( sb, "", 0 );
105
106 append( sb, "pomPackagingOnly (Default: true)", 2 );
107 append( sb, "(no description available)", 3 );
108 append( sb, "", 0 );
109
110 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
111 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
112 append( sb, "", 0 );
113 }
114 }
115
116 if ( goal == null || goal.length() <= 0 || "deploy".equals( goal ) )
117 {
118 append( sb, "site:deploy", 0 );
119 append( sb, "Deploys the generated site using scp or file protocol to the site URL specified in the <distributionManagement> section of the POM.\nFor scp protocol, the website files are packaged into zip archive, then the archive is transfered to the remote host, next it is un-archived. This method of deployment should normally be much faster than making a file by file copy. For file protocol, the files are copied directly to the destination directory.\n", 1 );
120 append( sb, "", 0 );
121 if ( detail )
122 {
123 append( sb, "Available parameters:", 1 );
124 append( sb, "", 0 );
125
126 append( sb, "chmod (Default: true)", 2 );
127 append( sb, "Whether to run the \'chmod\' command on the remote site after the deploy. Defaults to \'true\'.", 3 );
128 append( sb, "Expression: ${maven.site.chmod}", 3 );
129 append( sb, "", 0 );
130
131 append( sb, "chmodMode (Default: g+w,a+rX)", 2 );
132 append( sb, "The mode used by the \'chmod\' command. Only used if chmod = true. Defaults to \'g+w,a+rX\'.", 3 );
133 append( sb, "Expression: ${maven.site.chmod.mode}", 3 );
134 append( sb, "", 0 );
135
136 append( sb, "chmodOptions (Default: -Rf)", 2 );
137 append( sb, "The options used by the \'chmod\' command. Only used if chmod = true. Defaults to \'-Rf\'.", 3 );
138 append( sb, "Expression: ${maven.site.chmod.options}", 3 );
139 append( sb, "", 0 );
140
141 append( sb, "inputDirectory", 2 );
142 append( sb, "Directory containing the generated project sites and report distributions.", 3 );
143 append( sb, "Required: Yes", 3 );
144 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
145 append( sb, "", 0 );
146
147 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
148 append( sb, "Specifies the input encoding.", 3 );
149 append( sb, "Expression: ${encoding}", 3 );
150 append( sb, "", 0 );
151
152 append( sb, "locales", 2 );
153 append( sb, "A comma separated list of locales supported by Maven. The first valid token will be the default Locale for this instance of the Java Virtual Machine.", 3 );
154 append( sb, "Expression: ${locales}", 3 );
155 append( sb, "", 0 );
156
157 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
158 append( sb, "Specifies the output encoding.", 3 );
159 append( sb, "Expression: ${outputEncoding}", 3 );
160 append( sb, "", 0 );
161
162 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
163 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
164 append( sb, "", 0 );
165
166 append( sb, "skipDeploy (Default: false)", 2 );
167 append( sb, "Set this to \'true\' to skip site deployment.", 3 );
168 append( sb, "Expression: ${maven.site.deploy.skip}", 3 );
169 append( sb, "", 0 );
170 }
171 }
172
173 if ( goal == null || goal.length() <= 0 || "effective-site".equals( goal ) )
174 {
175 append( sb, "site:effective-site", 0 );
176 append( sb, "Displays the effective site descriptor as an XML for this build, after inheritance and interpolation of site.xml.", 1 );
177 append( sb, "", 0 );
178 if ( detail )
179 {
180 append( sb, "Available parameters:", 1 );
181 append( sb, "", 0 );
182
183 append( sb, "attributes", 2 );
184 append( sb, "The template properties for rendering the site.", 3 );
185 append( sb, "", 0 );
186
187 append( sb, "generatedSiteDirectory (Default: ${project.build.directory}/generated-site)", 2 );
188 append( sb, "Directory containing generated documentation. This is used to pick up other source docs that might have been generated at build time.", 3 );
189 append( sb, "", 0 );
190
191 append( sb, "generateProjectInfo (Default: true)", 2 );
192 append( sb, "Whether to generate the summary page for project reports: project-info.html.", 3 );
193 append( sb, "Expression: ${generateProjectInfo}", 3 );
194 append( sb, "", 0 );
195
196 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
197 append( sb, "Specifies the input encoding.", 3 );
198 append( sb, "Expression: ${encoding}", 3 );
199 append( sb, "", 0 );
200
201 append( sb, "locales", 2 );
202 append( sb, "A comma separated list of locales supported by Maven. The first valid token will be the default Locale for this instance of the Java Virtual Machine.", 3 );
203 append( sb, "Expression: ${locales}", 3 );
204 append( sb, "", 0 );
205
206 append( sb, "moduleExcludes", 2 );
207 append( sb, "Module type exclusion mappings ex: fml -> **/*-m1.fml (excludes fml files ending in \'-m1.fml\' recursively)\n>The configuration looks like this:\n\n\u00a0\u00a0<moduleExcludes>\n\u00a0\u00a0\u00a0\u00a0<moduleType>filename1.ext,**/*sample.ext</moduleType>\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0moduleType\u00a0can\u00a0be\u00a0one\u00a0of\u00a0\'apt\',\u00a0\'fml\'\u00a0or\u00a0\'xdoc\'.\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0The\u00a0value\u00a0is\u00a0a\u00a0comma\u00a0separated\u00a0list\u00a0of\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0filenames\u00a0or\u00a0fileset\u00a0patterns.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0Here\'s\u00a0an\u00a0example:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<xdoc>changes.xml,navigation.xml</xdoc>\n\u00a0\u00a0</moduleExcludes>\n", 3 );
208 append( sb, "", 0 );
209
210 append( sb, "output", 2 );
211 append( sb, "Optional parameter to write the output of this help in a given file, instead of writing to the console.\nNote: Could be a relative path.", 3 );
212 append( sb, "Expression: ${output}", 3 );
213 append( sb, "", 0 );
214
215 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
216 append( sb, "Specifies the output encoding.", 3 );
217 append( sb, "Expression: ${outputEncoding}", 3 );
218 append( sb, "", 0 );
219
220 append( sb, "relativizeDecorationLinks (Default: true)", 2 );
221 append( sb, "Make links in the site descriptor relative to the project URL. By default, any absolute links that appear in the site descriptor, e.g. banner hrefs, breadcrumbs, menu links, etc., will be made relative to project.url. Links will not be changed if this is set to false, or if the project has no URL defined.", 3 );
222 append( sb, "Expression: ${relativizeDecorationLinks}", 3 );
223 append( sb, "", 0 );
224
225 append( sb, "reportPlugins", 2 );
226 append( sb, "Report plugins (Maven 3).", 3 );
227 append( sb, "", 0 );
228
229 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
230 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
231 append( sb, "", 0 );
232
233 append( sb, "template", 2 );
234 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
235 append( sb, "", 0 );
236 append( sb, "Default template page.", 3 );
237 append( sb, "Expression: ${template}", 3 );
238 append( sb, "", 0 );
239
240 append( sb, "templateDirectory (Default: src/site)", 2 );
241 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
242 append( sb, "", 0 );
243 append( sb, "Directory containing the template page.", 3 );
244 append( sb, "Expression: ${templateDirectory}", 3 );
245 append( sb, "", 0 );
246
247 append( sb, "templateFile", 2 );
248 append( sb, "The location of a Velocity template file to use. When used, skins and the default templates, CSS and images are disabled. It is highly recommended that you package this as a skin instead.", 3 );
249 append( sb, "Expression: ${templateFile}", 3 );
250 append( sb, "", 0 );
251
252 append( sb, "xdocDirectory (Default: ${basedir}/xdocs)", 2 );
253 append( sb, "Deprecated. use the standard m2 directory layout", 3 );
254 append( sb, "", 0 );
255 append( sb, "Alternative directory for xdoc source, useful for m1 to m2 migration", 3 );
256 append( sb, "", 0 );
257 }
258 }
259
260 if ( goal == null || goal.length() <= 0 || "help".equals( goal ) )
261 {
262 append( sb, "site:help", 0 );
263 append( sb, "Display help information on maven-site-plugin.\nCall\n\u00a0\u00a0mvn\u00a0site:help\u00a0-Ddetail=true\u00a0-Dgoal=<goal-name>\nto display parameter details.", 1 );
264 append( sb, "", 0 );
265 if ( detail )
266 {
267 append( sb, "Available parameters:", 1 );
268 append( sb, "", 0 );
269
270 append( sb, "detail (Default: false)", 2 );
271 append( sb, "If true, display all settable properties for each goal.", 3 );
272 append( sb, "Expression: ${detail}", 3 );
273 append( sb, "", 0 );
274
275 append( sb, "goal", 2 );
276 append( sb, "The name of the goal for which to show help. If unspecified, all goals will be displayed.", 3 );
277 append( sb, "Expression: ${goal}", 3 );
278 append( sb, "", 0 );
279
280 append( sb, "indentSize (Default: 2)", 2 );
281 append( sb, "The number of spaces per indentation level, should be positive.", 3 );
282 append( sb, "Expression: ${indentSize}", 3 );
283 append( sb, "", 0 );
284
285 append( sb, "lineLength (Default: 80)", 2 );
286 append( sb, "The maximum length of a display line, should be positive.", 3 );
287 append( sb, "Expression: ${lineLength}", 3 );
288 append( sb, "", 0 );
289 }
290 }
291
292 if ( goal == null || goal.length() <= 0 || "jar".equals( goal ) )
293 {
294 append( sb, "site:jar", 0 );
295 append( sb, "Bundles the site output into a JAR so that it can be deployed to a repository.", 1 );
296 append( sb, "", 0 );
297 if ( detail )
298 {
299 append( sb, "Available parameters:", 1 );
300 append( sb, "", 0 );
301
302 append( sb, "attach (Default: true)", 2 );
303 append( sb, "Specifies whether to attach the generated artifact to the project.", 3 );
304 append( sb, "Expression: ${site.attach}", 3 );
305 append( sb, "", 0 );
306
307 append( sb, "attributes", 2 );
308 append( sb, "The template properties for rendering the site.", 3 );
309 append( sb, "", 0 );
310
311 append( sb, "finalName", 2 );
312 append( sb, "Specifies the filename that will be used for the generated jar file. Please note that \'-site\' will be appended to the file name.", 3 );
313 append( sb, "Required: Yes", 3 );
314 append( sb, "Expression: ${project.build.finalName}", 3 );
315 append( sb, "", 0 );
316
317 append( sb, "generatedSiteDirectory (Default: ${project.build.directory}/generated-site)", 2 );
318 append( sb, "Directory containing generated documentation. This is used to pick up other source docs that might have been generated at build time.", 3 );
319 append( sb, "", 0 );
320
321 append( sb, "generateProjectInfo (Default: true)", 2 );
322 append( sb, "Whether to generate the summary page for project reports: project-info.html.", 3 );
323 append( sb, "Expression: ${generateProjectInfo}", 3 );
324 append( sb, "", 0 );
325
326 append( sb, "generateReports (Default: true)", 2 );
327 append( sb, "Convenience parameter that allows you to disable report generation.", 3 );
328 append( sb, "Expression: ${generateReports}", 3 );
329 append( sb, "", 0 );
330
331 append( sb, "generateSitemap (Default: false)", 2 );
332 append( sb, "Generate a sitemap. The result will be a \'sitemap.html\' file at the site root.", 3 );
333 append( sb, "Expression: ${generateSitemap}", 3 );
334 append( sb, "", 0 );
335
336 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
337 append( sb, "Specifies the input encoding.", 3 );
338 append( sb, "Expression: ${encoding}", 3 );
339 append( sb, "", 0 );
340
341 append( sb, "jarOutputDirectory", 2 );
342 append( sb, "Specifies the directory where the generated jar file will be put.", 3 );
343 append( sb, "Required: Yes", 3 );
344 append( sb, "Expression: ${project.build.directory}", 3 );
345 append( sb, "", 0 );
346
347 append( sb, "locales", 2 );
348 append( sb, "A comma separated list of locales supported by Maven. The first valid token will be the default Locale for this instance of the Java Virtual Machine.", 3 );
349 append( sb, "Expression: ${locales}", 3 );
350 append( sb, "", 0 );
351
352 append( sb, "moduleExcludes", 2 );
353 append( sb, "Module type exclusion mappings ex: fml -> **/*-m1.fml (excludes fml files ending in \'-m1.fml\' recursively)\n>The configuration looks like this:\n\n\u00a0\u00a0<moduleExcludes>\n\u00a0\u00a0\u00a0\u00a0<moduleType>filename1.ext,**/*sample.ext</moduleType>\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0moduleType\u00a0can\u00a0be\u00a0one\u00a0of\u00a0\'apt\',\u00a0\'fml\'\u00a0or\u00a0\'xdoc\'.\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0The\u00a0value\u00a0is\u00a0a\u00a0comma\u00a0separated\u00a0list\u00a0of\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0filenames\u00a0or\u00a0fileset\u00a0patterns.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0Here\'s\u00a0an\u00a0example:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<xdoc>changes.xml,navigation.xml</xdoc>\n\u00a0\u00a0</moduleExcludes>\n", 3 );
354 append( sb, "", 0 );
355
356 append( sb, "outputDirectory (Default: ${project.reporting.outputDirectory})", 2 );
357 append( sb, "Directory where the project sites and report distributions will be generated.", 3 );
358 append( sb, "Expression: ${siteOutputDirectory}", 3 );
359 append( sb, "", 0 );
360
361 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
362 append( sb, "Specifies the output encoding.", 3 );
363 append( sb, "Expression: ${outputEncoding}", 3 );
364 append( sb, "", 0 );
365
366 append( sb, "relativizeDecorationLinks (Default: true)", 2 );
367 append( sb, "Make links in the site descriptor relative to the project URL. By default, any absolute links that appear in the site descriptor, e.g. banner hrefs, breadcrumbs, menu links, etc., will be made relative to project.url. Links will not be changed if this is set to false, or if the project has no URL defined.", 3 );
368 append( sb, "Expression: ${relativizeDecorationLinks}", 3 );
369 append( sb, "", 0 );
370
371 append( sb, "reportPlugins", 2 );
372 append( sb, "Report plugins (Maven 3).", 3 );
373 append( sb, "", 0 );
374
375 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
376 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
377 append( sb, "", 0 );
378
379 append( sb, "skip (Default: false)", 2 );
380 append( sb, "Set this to \'true\' to skip site generation.", 3 );
381 append( sb, "Expression: ${maven.site.skip}", 3 );
382 append( sb, "", 0 );
383
384 append( sb, "template", 2 );
385 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
386 append( sb, "", 0 );
387 append( sb, "Default template page.", 3 );
388 append( sb, "Expression: ${template}", 3 );
389 append( sb, "", 0 );
390
391 append( sb, "templateDirectory (Default: src/site)", 2 );
392 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
393 append( sb, "", 0 );
394 append( sb, "Directory containing the template page.", 3 );
395 append( sb, "Expression: ${templateDirectory}", 3 );
396 append( sb, "", 0 );
397
398 append( sb, "templateFile", 2 );
399 append( sb, "The location of a Velocity template file to use. When used, skins and the default templates, CSS and images are disabled. It is highly recommended that you package this as a skin instead.", 3 );
400 append( sb, "Expression: ${templateFile}", 3 );
401 append( sb, "", 0 );
402
403 append( sb, "validate (Default: false)", 2 );
404 append( sb, "Whether to validate xml input documents. If set to true, all input documents in xml format (in particular xdoc and fml) will be validated and any error will lead to a build failure.", 3 );
405 append( sb, "Expression: ${validate}", 3 );
406 append( sb, "", 0 );
407
408 append( sb, "xdocDirectory (Default: ${basedir}/xdocs)", 2 );
409 append( sb, "Deprecated. use the standard m2 directory layout", 3 );
410 append( sb, "", 0 );
411 append( sb, "Alternative directory for xdoc source, useful for m1 to m2 migration", 3 );
412 append( sb, "", 0 );
413 }
414 }
415
416 if ( goal == null || goal.length() <= 0 || "run".equals( goal ) )
417 {
418 append( sb, "site:run", 0 );
419 append( sb, "Starts the site up, rendering documents as requested for faster editing. It uses Jetty as the web server.", 1 );
420 append( sb, "", 0 );
421 if ( detail )
422 {
423 append( sb, "Available parameters:", 1 );
424 append( sb, "", 0 );
425
426 append( sb, "attributes", 2 );
427 append( sb, "The template properties for rendering the site.", 3 );
428 append( sb, "", 0 );
429
430 append( sb, "generatedSiteDirectory (Default: ${project.build.directory}/generated-site)", 2 );
431 append( sb, "Directory containing generated documentation. This is used to pick up other source docs that might have been generated at build time.", 3 );
432 append( sb, "", 0 );
433
434 append( sb, "generateProjectInfo (Default: true)", 2 );
435 append( sb, "Whether to generate the summary page for project reports: project-info.html.", 3 );
436 append( sb, "Expression: ${generateProjectInfo}", 3 );
437 append( sb, "", 0 );
438
439 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
440 append( sb, "Specifies the input encoding.", 3 );
441 append( sb, "Expression: ${encoding}", 3 );
442 append( sb, "", 0 );
443
444 append( sb, "locales", 2 );
445 append( sb, "A comma separated list of locales supported by Maven. The first valid token will be the default Locale for this instance of the Java Virtual Machine.", 3 );
446 append( sb, "Expression: ${locales}", 3 );
447 append( sb, "", 0 );
448
449 append( sb, "moduleExcludes", 2 );
450 append( sb, "Module type exclusion mappings ex: fml -> **/*-m1.fml (excludes fml files ending in \'-m1.fml\' recursively)\n>The configuration looks like this:\n\n\u00a0\u00a0<moduleExcludes>\n\u00a0\u00a0\u00a0\u00a0<moduleType>filename1.ext,**/*sample.ext</moduleType>\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0moduleType\u00a0can\u00a0be\u00a0one\u00a0of\u00a0\'apt\',\u00a0\'fml\'\u00a0or\u00a0\'xdoc\'.\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0The\u00a0value\u00a0is\u00a0a\u00a0comma\u00a0separated\u00a0list\u00a0of\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0filenames\u00a0or\u00a0fileset\u00a0patterns.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0Here\'s\u00a0an\u00a0example:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<xdoc>changes.xml,navigation.xml</xdoc>\n\u00a0\u00a0</moduleExcludes>\n", 3 );
451 append( sb, "", 0 );
452
453 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
454 append( sb, "Specifies the output encoding.", 3 );
455 append( sb, "Expression: ${outputEncoding}", 3 );
456 append( sb, "", 0 );
457
458 append( sb, "port (Default: 8080)", 2 );
459 append( sb, "The port to execute the HTTP server on.", 3 );
460 append( sb, "Expression: ${port}", 3 );
461 append( sb, "", 0 );
462
463 append( sb, "relativizeDecorationLinks (Default: true)", 2 );
464 append( sb, "Make links in the site descriptor relative to the project URL. By default, any absolute links that appear in the site descriptor, e.g. banner hrefs, breadcrumbs, menu links, etc., will be made relative to project.url. Links will not be changed if this is set to false, or if the project has no URL defined.", 3 );
465 append( sb, "Expression: ${relativizeDecorationLinks}", 3 );
466 append( sb, "", 0 );
467
468 append( sb, "reportPlugins", 2 );
469 append( sb, "Report plugins (Maven 3).", 3 );
470 append( sb, "", 0 );
471
472 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
473 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
474 append( sb, "", 0 );
475
476 append( sb, "template", 2 );
477 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
478 append( sb, "", 0 );
479 append( sb, "Default template page.", 3 );
480 append( sb, "Expression: ${template}", 3 );
481 append( sb, "", 0 );
482
483 append( sb, "templateDirectory (Default: src/site)", 2 );
484 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
485 append( sb, "", 0 );
486 append( sb, "Directory containing the template page.", 3 );
487 append( sb, "Expression: ${templateDirectory}", 3 );
488 append( sb, "", 0 );
489
490 append( sb, "templateFile", 2 );
491 append( sb, "The location of a Velocity template file to use. When used, skins and the default templates, CSS and images are disabled. It is highly recommended that you package this as a skin instead.", 3 );
492 append( sb, "Expression: ${templateFile}", 3 );
493 append( sb, "", 0 );
494
495 append( sb, "tempWebappDirectory", 2 );
496 append( sb, "Where to create the dummy web application.", 3 );
497 append( sb, "Expression: ${project.build.directory}/site-webapp", 3 );
498 append( sb, "", 0 );
499
500 append( sb, "xdocDirectory (Default: ${basedir}/xdocs)", 2 );
501 append( sb, "Deprecated. use the standard m2 directory layout", 3 );
502 append( sb, "", 0 );
503 append( sb, "Alternative directory for xdoc source, useful for m1 to m2 migration", 3 );
504 append( sb, "", 0 );
505 }
506 }
507
508 if ( goal == null || goal.length() <= 0 || "site".equals( goal ) )
509 {
510 append( sb, "site:site", 0 );
511 append( sb, "Generates the site for a single project.\nNote that links between module sites in a multi module build will not work.\n", 1 );
512 append( sb, "", 0 );
513 if ( detail )
514 {
515 append( sb, "Available parameters:", 1 );
516 append( sb, "", 0 );
517
518 append( sb, "attributes", 2 );
519 append( sb, "The template properties for rendering the site.", 3 );
520 append( sb, "", 0 );
521
522 append( sb, "generatedSiteDirectory (Default: ${project.build.directory}/generated-site)", 2 );
523 append( sb, "Directory containing generated documentation. This is used to pick up other source docs that might have been generated at build time.", 3 );
524 append( sb, "", 0 );
525
526 append( sb, "generateProjectInfo (Default: true)", 2 );
527 append( sb, "Whether to generate the summary page for project reports: project-info.html.", 3 );
528 append( sb, "Expression: ${generateProjectInfo}", 3 );
529 append( sb, "", 0 );
530
531 append( sb, "generateReports (Default: true)", 2 );
532 append( sb, "Convenience parameter that allows you to disable report generation.", 3 );
533 append( sb, "Expression: ${generateReports}", 3 );
534 append( sb, "", 0 );
535
536 append( sb, "generateSitemap (Default: false)", 2 );
537 append( sb, "Generate a sitemap. The result will be a \'sitemap.html\' file at the site root.", 3 );
538 append( sb, "Expression: ${generateSitemap}", 3 );
539 append( sb, "", 0 );
540
541 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
542 append( sb, "Specifies the input encoding.", 3 );
543 append( sb, "Expression: ${encoding}", 3 );
544 append( sb, "", 0 );
545
546 append( sb, "locales", 2 );
547 append( sb, "A comma separated list of locales supported by Maven. The first valid token will be the default Locale for this instance of the Java Virtual Machine.", 3 );
548 append( sb, "Expression: ${locales}", 3 );
549 append( sb, "", 0 );
550
551 append( sb, "moduleExcludes", 2 );
552 append( sb, "Module type exclusion mappings ex: fml -> **/*-m1.fml (excludes fml files ending in \'-m1.fml\' recursively)\n>The configuration looks like this:\n\n\u00a0\u00a0<moduleExcludes>\n\u00a0\u00a0\u00a0\u00a0<moduleType>filename1.ext,**/*sample.ext</moduleType>\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0moduleType\u00a0can\u00a0be\u00a0one\u00a0of\u00a0\'apt\',\u00a0\'fml\'\u00a0or\u00a0\'xdoc\'.\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0The\u00a0value\u00a0is\u00a0a\u00a0comma\u00a0separated\u00a0list\u00a0of\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0filenames\u00a0or\u00a0fileset\u00a0patterns.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<!--\u00a0Here\'s\u00a0an\u00a0example:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0-->\n\u00a0\u00a0\u00a0\u00a0<xdoc>changes.xml,navigation.xml</xdoc>\n\u00a0\u00a0</moduleExcludes>\n", 3 );
553 append( sb, "", 0 );
554
555 append( sb, "outputDirectory (Default: ${project.reporting.outputDirectory})", 2 );
556 append( sb, "Directory where the project sites and report distributions will be generated.", 3 );
557 append( sb, "Expression: ${siteOutputDirectory}", 3 );
558 append( sb, "", 0 );
559
560 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
561 append( sb, "Specifies the output encoding.", 3 );
562 append( sb, "Expression: ${outputEncoding}", 3 );
563 append( sb, "", 0 );
564
565 append( sb, "relativizeDecorationLinks (Default: true)", 2 );
566 append( sb, "Make links in the site descriptor relative to the project URL. By default, any absolute links that appear in the site descriptor, e.g. banner hrefs, breadcrumbs, menu links, etc., will be made relative to project.url. Links will not be changed if this is set to false, or if the project has no URL defined.", 3 );
567 append( sb, "Expression: ${relativizeDecorationLinks}", 3 );
568 append( sb, "", 0 );
569
570 append( sb, "reportPlugins", 2 );
571 append( sb, "Report plugins (Maven 3).", 3 );
572 append( sb, "", 0 );
573
574 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
575 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
576 append( sb, "", 0 );
577
578 append( sb, "skip (Default: false)", 2 );
579 append( sb, "Set this to \'true\' to skip site generation.", 3 );
580 append( sb, "Expression: ${maven.site.skip}", 3 );
581 append( sb, "", 0 );
582
583 append( sb, "template", 2 );
584 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
585 append( sb, "", 0 );
586 append( sb, "Default template page.", 3 );
587 append( sb, "Expression: ${template}", 3 );
588 append( sb, "", 0 );
589
590 append( sb, "templateDirectory (Default: src/site)", 2 );
591 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
592 append( sb, "", 0 );
593 append( sb, "Directory containing the template page.", 3 );
594 append( sb, "Expression: ${templateDirectory}", 3 );
595 append( sb, "", 0 );
596
597 append( sb, "templateFile", 2 );
598 append( sb, "The location of a Velocity template file to use. When used, skins and the default templates, CSS and images are disabled. It is highly recommended that you package this as a skin instead.", 3 );
599 append( sb, "Expression: ${templateFile}", 3 );
600 append( sb, "", 0 );
601
602 append( sb, "validate (Default: false)", 2 );
603 append( sb, "Whether to validate xml input documents. If set to true, all input documents in xml format (in particular xdoc and fml) will be validated and any error will lead to a build failure.", 3 );
604 append( sb, "Expression: ${validate}", 3 );
605 append( sb, "", 0 );
606
607 append( sb, "xdocDirectory (Default: ${basedir}/xdocs)", 2 );
608 append( sb, "Deprecated. use the standard m2 directory layout", 3 );
609 append( sb, "", 0 );
610 append( sb, "Alternative directory for xdoc source, useful for m1 to m2 migration", 3 );
611 append( sb, "", 0 );
612 }
613 }
614
615 if ( goal == null || goal.length() <= 0 || "stage".equals( goal ) )
616 {
617 append( sb, "site:stage", 0 );
618 append( sb, "Generates a site in a local staging or mock directory based on the site URL specified in the <distributionManagement> section of the POM.\nIt can be used to test that links between module sites in a multi module build works.\n", 1 );
619 append( sb, "", 0 );
620 if ( detail )
621 {
622 append( sb, "Available parameters:", 1 );
623 append( sb, "", 0 );
624
625 append( sb, "chmod (Default: true)", 2 );
626 append( sb, "Whether to run the \'chmod\' command on the remote site after the deploy. Defaults to \'true\'.", 3 );
627 append( sb, "Expression: ${maven.site.chmod}", 3 );
628 append( sb, "", 0 );
629
630 append( sb, "chmodMode (Default: g+w,a+rX)", 2 );
631 append( sb, "The mode used by the \'chmod\' command. Only used if chmod = true. Defaults to \'g+w,a+rX\'.", 3 );
632 append( sb, "Expression: ${maven.site.chmod.mode}", 3 );
633 append( sb, "", 0 );
634
635 append( sb, "chmodOptions (Default: -Rf)", 2 );
636 append( sb, "The options used by the \'chmod\' command. Only used if chmod = true. Defaults to \'-Rf\'.", 3 );
637 append( sb, "Expression: ${maven.site.chmod.options}", 3 );
638 append( sb, "", 0 );
639
640 append( sb, "inputDirectory", 2 );
641 append( sb, "Directory containing the generated project sites and report distributions.", 3 );
642 append( sb, "Required: Yes", 3 );
643 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
644 append( sb, "", 0 );
645
646 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
647 append( sb, "Specifies the input encoding.", 3 );
648 append( sb, "Expression: ${encoding}", 3 );
649 append( sb, "", 0 );
650
651 append( sb, "locales", 2 );
652 append( sb, "A comma separated list of locales supported by Maven. The first valid token will be the default Locale for this instance of the Java Virtual Machine.", 3 );
653 append( sb, "Expression: ${locales}", 3 );
654 append( sb, "", 0 );
655
656 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
657 append( sb, "Specifies the output encoding.", 3 );
658 append( sb, "Expression: ${outputEncoding}", 3 );
659 append( sb, "", 0 );
660
661 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
662 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
663 append( sb, "", 0 );
664
665 append( sb, "skipDeploy (Default: false)", 2 );
666 append( sb, "Set this to \'true\' to skip site deployment.", 3 );
667 append( sb, "Expression: ${maven.site.deploy.skip}", 3 );
668 append( sb, "", 0 );
669
670 append( sb, "stagingDirectory", 2 );
671 append( sb, "Staging directory location. This needs to be an absolute path, like C:\\stagingArea\\myProject\\ on Windows or /stagingArea/myProject/ on Unix. If this is not specified, the site will be staged in ${project.build.directory}/staging.", 3 );
672 append( sb, "Expression: ${stagingDirectory}", 3 );
673 append( sb, "", 0 );
674 }
675 }
676
677 if ( goal == null || goal.length() <= 0 || "stage-deploy".equals( goal ) )
678 {
679 append( sb, "site:stage-deploy", 0 );
680 append( sb, "Deploys the generated site to a staging or mock directory to the site URL specified in the <distributionManagement> section of the POM. It supports scp and file protocols for deployment.", 1 );
681 append( sb, "", 0 );
682 if ( detail )
683 {
684 append( sb, "Available parameters:", 1 );
685 append( sb, "", 0 );
686
687 append( sb, "chmod (Default: true)", 2 );
688 append( sb, "Whether to run the \'chmod\' command on the remote site after the deploy. Defaults to \'true\'.", 3 );
689 append( sb, "Expression: ${maven.site.chmod}", 3 );
690 append( sb, "", 0 );
691
692 append( sb, "chmodMode (Default: g+w,a+rX)", 2 );
693 append( sb, "The mode used by the \'chmod\' command. Only used if chmod = true. Defaults to \'g+w,a+rX\'.", 3 );
694 append( sb, "Expression: ${maven.site.chmod.mode}", 3 );
695 append( sb, "", 0 );
696
697 append( sb, "chmodOptions (Default: -Rf)", 2 );
698 append( sb, "The options used by the \'chmod\' command. Only used if chmod = true. Defaults to \'-Rf\'.", 3 );
699 append( sb, "Expression: ${maven.site.chmod.options}", 3 );
700 append( sb, "", 0 );
701
702 append( sb, "inputDirectory", 2 );
703 append( sb, "Directory containing the generated project sites and report distributions.", 3 );
704 append( sb, "Required: Yes", 3 );
705 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
706 append( sb, "", 0 );
707
708 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
709 append( sb, "Specifies the input encoding.", 3 );
710 append( sb, "Expression: ${encoding}", 3 );
711 append( sb, "", 0 );
712
713 append( sb, "locales", 2 );
714 append( sb, "A comma separated list of locales supported by Maven. The first valid token will be the default Locale for this instance of the Java Virtual Machine.", 3 );
715 append( sb, "Expression: ${locales}", 3 );
716 append( sb, "", 0 );
717
718 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
719 append( sb, "Specifies the output encoding.", 3 );
720 append( sb, "Expression: ${outputEncoding}", 3 );
721 append( sb, "", 0 );
722
723 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
724 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
725 append( sb, "", 0 );
726
727 append( sb, "skipDeploy (Default: false)", 2 );
728 append( sb, "Set this to \'true\' to skip site deployment.", 3 );
729 append( sb, "Expression: ${maven.site.deploy.skip}", 3 );
730 append( sb, "", 0 );
731
732 append( sb, "stagingRepositoryId", 2 );
733 append( sb, "The identifier of the repository where the staging site will be deployed. This id will be used to lookup a corresponding <server> entry from the settings.xml. If a matching <server> entry is found, its configured credentials will be used for authentication. If this is not specified, then the corresponding value of distributionManagement.site.id will be taken as default, unless this is not defined either then the String \'stagingSite\' is used. (Note: until v. 2.3 and 3.0-beta-3 the String \'stagingSite\' is always used.)", 3 );
734 append( sb, "Expression: ${stagingRepositoryId}", 3 );
735 append( sb, "", 0 );
736
737 append( sb, "stagingSiteURL", 2 );
738 append( sb, "The staged site will be deployed to this URL. If you don\'t specify this, the default-value will be \'${project.distributionManagement.site.url}/staging\', where \'project\' is either the current project or, in a reactor build, the top level project in the reactor.\nNote that even if you specify this plugin parameter you still need to indicate ${project.distributionManagement.site.url} at least in your top level project in order for relative links between modules to be resolved correctly.\n", 3 );
739 append( sb, "Expression: ${stagingSiteURL}", 3 );
740 append( sb, "", 0 );
741 }
742 }
743
744 if ( getLog().isInfoEnabled() )
745 {
746 getLog().info( sb.toString() );
747 }
748 }
749
750
751
752
753
754
755
756
757
758
759 private static String repeat( String str, int repeat )
760 {
761 StringBuffer buffer = new StringBuffer( repeat * str.length() );
762
763 for ( int i = 0; i < repeat; i++ )
764 {
765 buffer.append( str );
766 }
767
768 return buffer.toString();
769 }
770
771
772
773
774
775
776
777
778
779 private void append( StringBuffer sb, String description, int indent )
780 {
781 for ( Iterator it = toLines( description, indent, indentSize, lineLength ).iterator(); it.hasNext(); )
782 {
783 sb.append( it.next().toString() ).append( '\n' );
784 }
785 }
786
787
788
789
790
791
792
793
794
795
796
797 private static List toLines( String text, int indent, int indentSize, int lineLength )
798 {
799 List lines = new ArrayList();
800
801 String ind = repeat( "\t", indent );
802 String[] plainLines = text.split( "(\r\n)|(\r)|(\n)" );
803 for ( int i = 0; i < plainLines.length; i++ )
804 {
805 toLines( lines, ind + plainLines[i], indentSize, lineLength );
806 }
807
808 return lines;
809 }
810
811
812
813
814
815
816
817
818
819 private static void toLines( List lines, String line, int indentSize, int lineLength )
820 {
821 int lineIndent = getIndentLevel( line );
822 StringBuffer buf = new StringBuffer( 256 );
823 String[] tokens = line.split( " +" );
824 for ( int i = 0; i < tokens.length; i++ )
825 {
826 String token = tokens[i];
827 if ( i > 0 )
828 {
829 if ( buf.length() + token.length() >= lineLength )
830 {
831 lines.add( buf.toString() );
832 buf.setLength( 0 );
833 buf.append( repeat( " ", lineIndent * indentSize ) );
834 }
835 else
836 {
837 buf.append( ' ' );
838 }
839 }
840 for ( int j = 0; j < token.length(); j++ )
841 {
842 char c = token.charAt( j );
843 if ( c == '\t' )
844 {
845 buf.append( repeat( " ", indentSize - buf.length() % indentSize ) );
846 }
847 else if ( c == '\u00A0' )
848 {
849 buf.append( ' ' );
850 }
851 else
852 {
853 buf.append( c );
854 }
855 }
856 }
857 lines.add( buf.toString() );
858 }
859
860
861
862
863
864
865
866 private static int getIndentLevel( String line )
867 {
868 int level = 0;
869 for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ )
870 {
871 level++;
872 }
873 for ( int i = level + 1; i <= level + 4 && i < line.length(); i++ )
874 {
875 if ( line.charAt( i ) == '\t' )
876 {
877 level++;
878 break;
879 }
880 }
881 return level;
882 }
883 }