View Javadoc

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   * Display help information on maven-site-plugin.<br/> Call <pre>  mvn site:help -Ddetail=true -Dgoal=&lt;goal-name&gt;</pre> to display parameter details.
12   *
13   * @version generated on Thu Apr 26 22:36:11 CEST 2012
14   * @author org.apache.maven.tools.plugin.generator.PluginHelpGenerator (version 2.7)
15   * @goal help
16   * @requiresProject false
17   * @threadSafe
18   */
19  public class HelpMojo
20      extends AbstractMojo
21  {
22      /**
23       * If <code>true</code>, display all settable properties for each goal.
24       * 
25       * @parameter expression="${detail}" default-value="false"
26       */
27      private boolean detail;
28  
29      /**
30       * The name of the goal for which to show help. If unspecified, all goals will be displayed.
31       * 
32       * @parameter expression="${goal}"
33       */
34      private java.lang.String goal;
35  
36      /**
37       * The maximum length of a display line, should be positive.
38       * 
39       * @parameter expression="${lineLength}" default-value="80"
40       */
41      private int lineLength;
42  
43      /**
44       * The number of spaces per indentation level, should be positive.
45       * 
46       * @parameter expression="${indentSize}" default-value="2"
47       */
48      private int indentSize;
49  
50  
51      /** {@inheritDoc} */
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:2.4", 0 );
69          append( sb, "", 0 );
70  
71          append( sb, "Maven Site Plugin 2", 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.", 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, "siteDirectory (Default: ${basedir}/src/site)", 2 );
107                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
108                 append( sb, "", 0 );
109             }
110         }
111 
112         if ( goal == null || goal.length() <= 0 || "deploy".equals( goal ) )
113         {
114             append( sb, "site:deploy", 0 );
115             append( sb, "Deploys the generated site using wagon supported protocols to the site URL specified in the <distributionManagement> section of the POM.\nFor scp protocol, the website files are packaged by wagon into zip archive, then the archive is transfered to the remote host, next it is un-archived which is much faster than making a file by file copy.\n", 1 );
116             append( sb, "", 0 );
117             if ( detail )
118             {
119                 append( sb, "Available parameters:", 1 );
120                 append( sb, "", 0 );
121 
122                 append( sb, "chmod (Default: true)", 2 );
123                 append( sb, "Whether to run the \'chmod\' command on the remote site after the deploy. Defaults to \'true\'.", 3 );
124                 append( sb, "Expression: ${maven.site.chmod}", 3 );
125                 append( sb, "", 0 );
126 
127                 append( sb, "chmodMode (Default: g+w,a+rX)", 2 );
128                 append( sb, "The mode used by the \'chmod\' command. Only used if chmod = true. Defaults to \'g+w,a+rX\'.", 3 );
129                 append( sb, "Expression: ${maven.site.chmod.mode}", 3 );
130                 append( sb, "", 0 );
131 
132                 append( sb, "chmodOptions (Default: -Rf)", 2 );
133                 append( sb, "The options used by the \'chmod\' command. Only used if chmod = true. Defaults to \'-Rf\'.", 3 );
134                 append( sb, "Expression: ${maven.site.chmod.options}", 3 );
135                 append( sb, "", 0 );
136 
137                 append( sb, "inputDirectory", 2 );
138                 append( sb, "Directory containing the generated project sites and report distributions.", 3 );
139                 append( sb, "Required: Yes", 3 );
140                 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
141                 append( sb, "", 0 );
142 
143                 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
144                 append( sb, "Specifies the input encoding.", 3 );
145                 append( sb, "Expression: ${encoding}", 3 );
146                 append( sb, "", 0 );
147 
148                 append( sb, "locales", 2 );
149                 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 );
150                 append( sb, "Expression: ${locales}", 3 );
151                 append( sb, "", 0 );
152 
153                 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
154                 append( sb, "Specifies the output encoding.", 3 );
155                 append( sb, "Expression: ${outputEncoding}", 3 );
156                 append( sb, "", 0 );
157 
158                 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
159                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
160                 append( sb, "", 0 );
161 
162                 append( sb, "skipDeploy (Default: false)", 2 );
163                 append( sb, "Set this to \'true\' to skip site deployment.", 3 );
164                 append( sb, "Expression: ${maven.site.deploy.skip}", 3 );
165                 append( sb, "", 0 );
166             }
167         }
168 
169         if ( goal == null || goal.length() <= 0 || "effective-site".equals( goal ) )
170         {
171             append( sb, "site:effective-site", 0 );
172             append( sb, "Displays the effective site descriptor as an XML for this build, after inheritance and interpolation of site.xml.", 1 );
173             append( sb, "", 0 );
174             if ( detail )
175             {
176                 append( sb, "Available parameters:", 1 );
177                 append( sb, "", 0 );
178 
179                 append( sb, "attributes", 2 );
180                 append( sb, "The template properties for rendering the site.", 3 );
181                 append( sb, "", 0 );
182 
183                 append( sb, "generatedSiteDirectory (Default: ${project.build.directory}/generated-site)", 2 );
184                 append( sb, "Directory containing generated documentation. This is used to pick up other source docs that might have been generated at build time.", 3 );
185                 append( sb, "", 0 );
186 
187                 append( sb, "generateProjectInfo (Default: true)", 2 );
188                 append( sb, "Whether to generate the summary page for project reports: project-info.html.", 3 );
189                 append( sb, "Expression: ${generateProjectInfo}", 3 );
190                 append( sb, "", 0 );
191 
192                 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
193                 append( sb, "Specifies the input encoding.", 3 );
194                 append( sb, "Expression: ${encoding}", 3 );
195                 append( sb, "", 0 );
196 
197                 append( sb, "locales", 2 );
198                 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 );
199                 append( sb, "Expression: ${locales}", 3 );
200                 append( sb, "", 0 );
201 
202                 append( sb, "moduleExcludes", 2 );
203                 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 );
204                 append( sb, "", 0 );
205 
206                 append( sb, "output", 2 );
207                 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 );
208                 append( sb, "Expression: ${output}", 3 );
209                 append( sb, "", 0 );
210 
211                 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
212                 append( sb, "Specifies the output encoding.", 3 );
213                 append( sb, "Expression: ${outputEncoding}", 3 );
214                 append( sb, "", 0 );
215 
216                 append( sb, "relativizeDecorationLinks (Default: true)", 2 );
217                 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 );
218                 append( sb, "Expression: ${relativizeDecorationLinks}", 3 );
219                 append( sb, "", 0 );
220 
221                 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
222                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
223                 append( sb, "", 0 );
224 
225                 append( sb, "template", 2 );
226                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
227                 append( sb, "", 0 );
228                 append( sb, "Default template page.", 3 );
229                 append( sb, "Expression: ${template}", 3 );
230                 append( sb, "", 0 );
231 
232                 append( sb, "templateDirectory (Default: src/site)", 2 );
233                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
234                 append( sb, "", 0 );
235                 append( sb, "Directory containing the template page.", 3 );
236                 append( sb, "Expression: ${templateDirectory}", 3 );
237                 append( sb, "", 0 );
238 
239                 append( sb, "templateFile", 2 );
240                 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 );
241                 append( sb, "Expression: ${templateFile}", 3 );
242                 append( sb, "", 0 );
243 
244                 append( sb, "xdocDirectory (Default: ${basedir}/xdocs)", 2 );
245                 append( sb, "Deprecated. use the standard m2 directory layout", 3 );
246                 append( sb, "", 0 );
247                 append( sb, "Alternative directory for xdoc source, useful for m1 to m2 migration", 3 );
248                 append( sb, "", 0 );
249             }
250         }
251 
252         if ( goal == null || goal.length() <= 0 || "help".equals( goal ) )
253         {
254             append( sb, "site:help", 0 );
255             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 );
256             append( sb, "", 0 );
257             if ( detail )
258             {
259                 append( sb, "Available parameters:", 1 );
260                 append( sb, "", 0 );
261 
262                 append( sb, "detail (Default: false)", 2 );
263                 append( sb, "If true, display all settable properties for each goal.", 3 );
264                 append( sb, "Expression: ${detail}", 3 );
265                 append( sb, "", 0 );
266 
267                 append( sb, "goal", 2 );
268                 append( sb, "The name of the goal for which to show help. If unspecified, all goals will be displayed.", 3 );
269                 append( sb, "Expression: ${goal}", 3 );
270                 append( sb, "", 0 );
271 
272                 append( sb, "indentSize (Default: 2)", 2 );
273                 append( sb, "The number of spaces per indentation level, should be positive.", 3 );
274                 append( sb, "Expression: ${indentSize}", 3 );
275                 append( sb, "", 0 );
276 
277                 append( sb, "lineLength (Default: 80)", 2 );
278                 append( sb, "The maximum length of a display line, should be positive.", 3 );
279                 append( sb, "Expression: ${lineLength}", 3 );
280                 append( sb, "", 0 );
281             }
282         }
283 
284         if ( goal == null || goal.length() <= 0 || "jar".equals( goal ) )
285         {
286             append( sb, "site:jar", 0 );
287             append( sb, "Bundles the site output into a JAR so that it can be deployed to a repository.", 1 );
288             append( sb, "", 0 );
289             if ( detail )
290             {
291                 append( sb, "Available parameters:", 1 );
292                 append( sb, "", 0 );
293 
294                 append( sb, "attach (Default: true)", 2 );
295                 append( sb, "Specifies whether to attach the generated artifact to the project.", 3 );
296                 append( sb, "Expression: ${site.attach}", 3 );
297                 append( sb, "", 0 );
298 
299                 append( sb, "attributes", 2 );
300                 append( sb, "The template properties for rendering the site.", 3 );
301                 append( sb, "", 0 );
302 
303                 append( sb, "finalName", 2 );
304                 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 );
305                 append( sb, "Required: Yes", 3 );
306                 append( sb, "Expression: ${project.build.finalName}", 3 );
307                 append( sb, "", 0 );
308 
309                 append( sb, "generatedSiteDirectory (Default: ${project.build.directory}/generated-site)", 2 );
310                 append( sb, "Directory containing generated documentation. This is used to pick up other source docs that might have been generated at build time.", 3 );
311                 append( sb, "", 0 );
312 
313                 append( sb, "generateProjectInfo (Default: true)", 2 );
314                 append( sb, "Whether to generate the summary page for project reports: project-info.html.", 3 );
315                 append( sb, "Expression: ${generateProjectInfo}", 3 );
316                 append( sb, "", 0 );
317 
318                 append( sb, "generateReports (Default: true)", 2 );
319                 append( sb, "Convenience parameter that allows you to disable report generation.", 3 );
320                 append( sb, "Expression: ${generateReports}", 3 );
321                 append( sb, "", 0 );
322 
323                 append( sb, "generateSitemap (Default: false)", 2 );
324                 append( sb, "Generate a sitemap. The result will be a \'sitemap.html\' file at the site root.", 3 );
325                 append( sb, "Expression: ${generateSitemap}", 3 );
326                 append( sb, "", 0 );
327 
328                 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
329                 append( sb, "Specifies the input encoding.", 3 );
330                 append( sb, "Expression: ${encoding}", 3 );
331                 append( sb, "", 0 );
332 
333                 append( sb, "jarOutputDirectory", 2 );
334                 append( sb, "Specifies the directory where the generated jar file will be put.", 3 );
335                 append( sb, "Required: Yes", 3 );
336                 append( sb, "Expression: ${project.build.directory}", 3 );
337                 append( sb, "", 0 );
338 
339                 append( sb, "locales", 2 );
340                 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 );
341                 append( sb, "Expression: ${locales}", 3 );
342                 append( sb, "", 0 );
343 
344                 append( sb, "moduleExcludes", 2 );
345                 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 );
346                 append( sb, "", 0 );
347 
348                 append( sb, "outputDirectory (Default: ${project.reporting.outputDirectory})", 2 );
349                 append( sb, "Directory where the project sites and report distributions will be generated.", 3 );
350                 append( sb, "Expression: ${siteOutputDirectory}", 3 );
351                 append( sb, "", 0 );
352 
353                 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
354                 append( sb, "Specifies the output encoding.", 3 );
355                 append( sb, "Expression: ${outputEncoding}", 3 );
356                 append( sb, "", 0 );
357 
358                 append( sb, "relativizeDecorationLinks (Default: true)", 2 );
359                 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 );
360                 append( sb, "Expression: ${relativizeDecorationLinks}", 3 );
361                 append( sb, "", 0 );
362 
363                 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
364                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
365                 append( sb, "", 0 );
366 
367                 append( sb, "skip (Default: false)", 2 );
368                 append( sb, "Set this to \'true\' to skip site generation.", 3 );
369                 append( sb, "Expression: ${maven.site.skip}", 3 );
370                 append( sb, "", 0 );
371 
372                 append( sb, "template", 2 );
373                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
374                 append( sb, "", 0 );
375                 append( sb, "Default template page.", 3 );
376                 append( sb, "Expression: ${template}", 3 );
377                 append( sb, "", 0 );
378 
379                 append( sb, "templateDirectory (Default: src/site)", 2 );
380                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
381                 append( sb, "", 0 );
382                 append( sb, "Directory containing the template page.", 3 );
383                 append( sb, "Expression: ${templateDirectory}", 3 );
384                 append( sb, "", 0 );
385 
386                 append( sb, "templateFile", 2 );
387                 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 );
388                 append( sb, "Expression: ${templateFile}", 3 );
389                 append( sb, "", 0 );
390 
391                 append( sb, "validate (Default: false)", 2 );
392                 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 );
393                 append( sb, "Expression: ${validate}", 3 );
394                 append( sb, "", 0 );
395 
396                 append( sb, "xdocDirectory (Default: ${basedir}/xdocs)", 2 );
397                 append( sb, "Deprecated. use the standard m2 directory layout", 3 );
398                 append( sb, "", 0 );
399                 append( sb, "Alternative directory for xdoc source, useful for m1 to m2 migration", 3 );
400                 append( sb, "", 0 );
401             }
402         }
403 
404         if ( goal == null || goal.length() <= 0 || "run".equals( goal ) )
405         {
406             append( sb, "site:run", 0 );
407             append( sb, "Starts the site up, rendering documents as requested for faster editing. It uses Jetty as the web server.", 1 );
408             append( sb, "", 0 );
409             if ( detail )
410             {
411                 append( sb, "Available parameters:", 1 );
412                 append( sb, "", 0 );
413 
414                 append( sb, "attributes", 2 );
415                 append( sb, "The template properties for rendering the site.", 3 );
416                 append( sb, "", 0 );
417 
418                 append( sb, "generatedSiteDirectory (Default: ${project.build.directory}/generated-site)", 2 );
419                 append( sb, "Directory containing generated documentation. This is used to pick up other source docs that might have been generated at build time.", 3 );
420                 append( sb, "", 0 );
421 
422                 append( sb, "generateProjectInfo (Default: true)", 2 );
423                 append( sb, "Whether to generate the summary page for project reports: project-info.html.", 3 );
424                 append( sb, "Expression: ${generateProjectInfo}", 3 );
425                 append( sb, "", 0 );
426 
427                 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
428                 append( sb, "Specifies the input encoding.", 3 );
429                 append( sb, "Expression: ${encoding}", 3 );
430                 append( sb, "", 0 );
431 
432                 append( sb, "locales", 2 );
433                 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 );
434                 append( sb, "Expression: ${locales}", 3 );
435                 append( sb, "", 0 );
436 
437                 append( sb, "moduleExcludes", 2 );
438                 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 );
439                 append( sb, "", 0 );
440 
441                 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
442                 append( sb, "Specifies the output encoding.", 3 );
443                 append( sb, "Expression: ${outputEncoding}", 3 );
444                 append( sb, "", 0 );
445 
446                 append( sb, "port (Default: 8080)", 2 );
447                 append( sb, "The port to execute the HTTP server on.", 3 );
448                 append( sb, "Expression: ${port}", 3 );
449                 append( sb, "", 0 );
450 
451                 append( sb, "relativizeDecorationLinks (Default: true)", 2 );
452                 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 );
453                 append( sb, "Expression: ${relativizeDecorationLinks}", 3 );
454                 append( sb, "", 0 );
455 
456                 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
457                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
458                 append( sb, "", 0 );
459 
460                 append( sb, "template", 2 );
461                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
462                 append( sb, "", 0 );
463                 append( sb, "Default template page.", 3 );
464                 append( sb, "Expression: ${template}", 3 );
465                 append( sb, "", 0 );
466 
467                 append( sb, "templateDirectory (Default: src/site)", 2 );
468                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
469                 append( sb, "", 0 );
470                 append( sb, "Directory containing the template page.", 3 );
471                 append( sb, "Expression: ${templateDirectory}", 3 );
472                 append( sb, "", 0 );
473 
474                 append( sb, "templateFile", 2 );
475                 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 );
476                 append( sb, "Expression: ${templateFile}", 3 );
477                 append( sb, "", 0 );
478 
479                 append( sb, "tempWebappDirectory", 2 );
480                 append( sb, "Where to create the dummy web application.", 3 );
481                 append( sb, "Expression: ${project.build.directory}/site-webapp", 3 );
482                 append( sb, "", 0 );
483 
484                 append( sb, "xdocDirectory (Default: ${basedir}/xdocs)", 2 );
485                 append( sb, "Deprecated. use the standard m2 directory layout", 3 );
486                 append( sb, "", 0 );
487                 append( sb, "Alternative directory for xdoc source, useful for m1 to m2 migration", 3 );
488                 append( sb, "", 0 );
489             }
490         }
491 
492         if ( goal == null || goal.length() <= 0 || "site".equals( goal ) )
493         {
494             append( sb, "site:site", 0 );
495             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 );
496             append( sb, "", 0 );
497             if ( detail )
498             {
499                 append( sb, "Available parameters:", 1 );
500                 append( sb, "", 0 );
501 
502                 append( sb, "attributes", 2 );
503                 append( sb, "The template properties for rendering the site.", 3 );
504                 append( sb, "", 0 );
505 
506                 append( sb, "generatedSiteDirectory (Default: ${project.build.directory}/generated-site)", 2 );
507                 append( sb, "Directory containing generated documentation. This is used to pick up other source docs that might have been generated at build time.", 3 );
508                 append( sb, "", 0 );
509 
510                 append( sb, "generateProjectInfo (Default: true)", 2 );
511                 append( sb, "Whether to generate the summary page for project reports: project-info.html.", 3 );
512                 append( sb, "Expression: ${generateProjectInfo}", 3 );
513                 append( sb, "", 0 );
514 
515                 append( sb, "generateReports (Default: true)", 2 );
516                 append( sb, "Convenience parameter that allows you to disable report generation.", 3 );
517                 append( sb, "Expression: ${generateReports}", 3 );
518                 append( sb, "", 0 );
519 
520                 append( sb, "generateSitemap (Default: false)", 2 );
521                 append( sb, "Generate a sitemap. The result will be a \'sitemap.html\' file at the site root.", 3 );
522                 append( sb, "Expression: ${generateSitemap}", 3 );
523                 append( sb, "", 0 );
524 
525                 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
526                 append( sb, "Specifies the input encoding.", 3 );
527                 append( sb, "Expression: ${encoding}", 3 );
528                 append( sb, "", 0 );
529 
530                 append( sb, "locales", 2 );
531                 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 );
532                 append( sb, "Expression: ${locales}", 3 );
533                 append( sb, "", 0 );
534 
535                 append( sb, "moduleExcludes", 2 );
536                 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 );
537                 append( sb, "", 0 );
538 
539                 append( sb, "outputDirectory (Default: ${project.reporting.outputDirectory})", 2 );
540                 append( sb, "Directory where the project sites and report distributions will be generated.", 3 );
541                 append( sb, "Expression: ${siteOutputDirectory}", 3 );
542                 append( sb, "", 0 );
543 
544                 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
545                 append( sb, "Specifies the output encoding.", 3 );
546                 append( sb, "Expression: ${outputEncoding}", 3 );
547                 append( sb, "", 0 );
548 
549                 append( sb, "relativizeDecorationLinks (Default: true)", 2 );
550                 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 );
551                 append( sb, "Expression: ${relativizeDecorationLinks}", 3 );
552                 append( sb, "", 0 );
553 
554                 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
555                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
556                 append( sb, "", 0 );
557 
558                 append( sb, "skip (Default: false)", 2 );
559                 append( sb, "Set this to \'true\' to skip site generation.", 3 );
560                 append( sb, "Expression: ${maven.site.skip}", 3 );
561                 append( sb, "", 0 );
562 
563                 append( sb, "template", 2 );
564                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
565                 append( sb, "", 0 );
566                 append( sb, "Default template page.", 3 );
567                 append( sb, "Expression: ${template}", 3 );
568                 append( sb, "", 0 );
569 
570                 append( sb, "templateDirectory (Default: src/site)", 2 );
571                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
572                 append( sb, "", 0 );
573                 append( sb, "Directory containing the template page.", 3 );
574                 append( sb, "Expression: ${templateDirectory}", 3 );
575                 append( sb, "", 0 );
576 
577                 append( sb, "templateFile", 2 );
578                 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 );
579                 append( sb, "Expression: ${templateFile}", 3 );
580                 append( sb, "", 0 );
581 
582                 append( sb, "validate (Default: false)", 2 );
583                 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 );
584                 append( sb, "Expression: ${validate}", 3 );
585                 append( sb, "", 0 );
586 
587                 append( sb, "xdocDirectory (Default: ${basedir}/xdocs)", 2 );
588                 append( sb, "Deprecated. use the standard m2 directory layout", 3 );
589                 append( sb, "", 0 );
590                 append( sb, "Alternative directory for xdoc source, useful for m1 to m2 migration", 3 );
591                 append( sb, "", 0 );
592             }
593         }
594 
595         if ( goal == null || goal.length() <= 0 || "stage".equals( goal ) )
596         {
597             append( sb, "site:stage", 0 );
598             append( sb, "Deploys the generated site to 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 );
599             append( sb, "", 0 );
600             if ( detail )
601             {
602                 append( sb, "Available parameters:", 1 );
603                 append( sb, "", 0 );
604 
605                 append( sb, "chmod (Default: true)", 2 );
606                 append( sb, "Whether to run the \'chmod\' command on the remote site after the deploy. Defaults to \'true\'.", 3 );
607                 append( sb, "Expression: ${maven.site.chmod}", 3 );
608                 append( sb, "", 0 );
609 
610                 append( sb, "chmodMode (Default: g+w,a+rX)", 2 );
611                 append( sb, "The mode used by the \'chmod\' command. Only used if chmod = true. Defaults to \'g+w,a+rX\'.", 3 );
612                 append( sb, "Expression: ${maven.site.chmod.mode}", 3 );
613                 append( sb, "", 0 );
614 
615                 append( sb, "chmodOptions (Default: -Rf)", 2 );
616                 append( sb, "The options used by the \'chmod\' command. Only used if chmod = true. Defaults to \'-Rf\'.", 3 );
617                 append( sb, "Expression: ${maven.site.chmod.options}", 3 );
618                 append( sb, "", 0 );
619 
620                 append( sb, "inputDirectory", 2 );
621                 append( sb, "Directory containing the generated project sites and report distributions.", 3 );
622                 append( sb, "Required: Yes", 3 );
623                 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
624                 append( sb, "", 0 );
625 
626                 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
627                 append( sb, "Specifies the input encoding.", 3 );
628                 append( sb, "Expression: ${encoding}", 3 );
629                 append( sb, "", 0 );
630 
631                 append( sb, "locales", 2 );
632                 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 );
633                 append( sb, "Expression: ${locales}", 3 );
634                 append( sb, "", 0 );
635 
636                 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
637                 append( sb, "Specifies the output encoding.", 3 );
638                 append( sb, "Expression: ${outputEncoding}", 3 );
639                 append( sb, "", 0 );
640 
641                 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
642                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
643                 append( sb, "", 0 );
644 
645                 append( sb, "skipDeploy (Default: false)", 2 );
646                 append( sb, "Set this to \'true\' to skip site deployment.", 3 );
647                 append( sb, "Expression: ${maven.site.deploy.skip}", 3 );
648                 append( sb, "", 0 );
649 
650                 append( sb, "stagingDirectory", 2 );
651                 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 );
652                 append( sb, "Expression: ${stagingDirectory}", 3 );
653                 append( sb, "", 0 );
654             }
655         }
656 
657         if ( goal == null || goal.length() <= 0 || "stage-deploy".equals( goal ) )
658         {
659             append( sb, "site:stage-deploy", 0 );
660             append( sb, "Deploys the generated site to a staging or mock directory to the site URL specified in the <distributionManagement> section of the POM, using wagon supported protocols", 1 );
661             append( sb, "", 0 );
662             if ( detail )
663             {
664                 append( sb, "Available parameters:", 1 );
665                 append( sb, "", 0 );
666 
667                 append( sb, "chmod (Default: true)", 2 );
668                 append( sb, "Whether to run the \'chmod\' command on the remote site after the deploy. Defaults to \'true\'.", 3 );
669                 append( sb, "Expression: ${maven.site.chmod}", 3 );
670                 append( sb, "", 0 );
671 
672                 append( sb, "chmodMode (Default: g+w,a+rX)", 2 );
673                 append( sb, "The mode used by the \'chmod\' command. Only used if chmod = true. Defaults to \'g+w,a+rX\'.", 3 );
674                 append( sb, "Expression: ${maven.site.chmod.mode}", 3 );
675                 append( sb, "", 0 );
676 
677                 append( sb, "chmodOptions (Default: -Rf)", 2 );
678                 append( sb, "The options used by the \'chmod\' command. Only used if chmod = true. Defaults to \'-Rf\'.", 3 );
679                 append( sb, "Expression: ${maven.site.chmod.options}", 3 );
680                 append( sb, "", 0 );
681 
682                 append( sb, "inputDirectory", 2 );
683                 append( sb, "Directory containing the generated project sites and report distributions.", 3 );
684                 append( sb, "Required: Yes", 3 );
685                 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
686                 append( sb, "", 0 );
687 
688                 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
689                 append( sb, "Specifies the input encoding.", 3 );
690                 append( sb, "Expression: ${encoding}", 3 );
691                 append( sb, "", 0 );
692 
693                 append( sb, "locales", 2 );
694                 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 );
695                 append( sb, "Expression: ${locales}", 3 );
696                 append( sb, "", 0 );
697 
698                 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
699                 append( sb, "Specifies the output encoding.", 3 );
700                 append( sb, "Expression: ${outputEncoding}", 3 );
701                 append( sb, "", 0 );
702 
703                 append( sb, "siteDirectory (Default: ${basedir}/src/site)", 2 );
704                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
705                 append( sb, "", 0 );
706 
707                 append( sb, "skipDeploy (Default: false)", 2 );
708                 append( sb, "Set this to \'true\' to skip site deployment.", 3 );
709                 append( sb, "Expression: ${maven.site.deploy.skip}", 3 );
710                 append( sb, "", 0 );
711 
712                 append( sb, "stagingRepositoryId", 2 );
713                 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 );
714                 append( sb, "Expression: ${stagingRepositoryId}", 3 );
715                 append( sb, "", 0 );
716 
717                 append( sb, "stagingSiteURL", 2 );
718                 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 );
719                 append( sb, "Expression: ${stagingSiteURL}", 3 );
720                 append( sb, "", 0 );
721             }
722         }
723 
724         if ( getLog().isInfoEnabled() )
725         {
726             getLog().info( sb.toString() );
727         }
728     }
729 
730     /**
731      * <p>Repeat a String <code>n</code> times to form a new string.</p>
732      *
733      * @param str String to repeat
734      * @param repeat number of times to repeat str
735      * @return String with repeated String
736      * @throws NegativeArraySizeException if <code>repeat < 0</code>
737      * @throws NullPointerException if str is <code>null</code>
738      */
739     private static String repeat( String str, int repeat )
740     {
741         StringBuffer buffer = new StringBuffer( repeat * str.length() );
742 
743         for ( int i = 0; i < repeat; i++ )
744         {
745             buffer.append( str );
746         }
747 
748         return buffer.toString();
749     }
750 
751     /** 
752      * Append a description to the buffer by respecting the indentSize and lineLength parameters.
753      * <b>Note</b>: The last character is always a new line.
754      * 
755      * @param sb The buffer to append the description, not <code>null</code>.
756      * @param description The description, not <code>null</code>.
757      * @param indent The base indentation level of each line, must not be negative.
758      */
759     private void append( StringBuffer sb, String description, int indent )
760     {
761         for ( Iterator it = toLines( description, indent, indentSize, lineLength ).iterator(); it.hasNext(); )
762         {
763             sb.append( it.next().toString() ).append( '\n' );
764         }
765     }
766 
767     /** 
768      * Splits the specified text into lines of convenient display length.
769      * 
770      * @param text The text to split into lines, must not be <code>null</code>.
771      * @param indent The base indentation level of each line, must not be negative.
772      * @param indentSize The size of each indentation, must not be negative.
773      * @param lineLength The length of the line, must not be negative.
774      * @return The sequence of display lines, never <code>null</code>.
775      * @throws NegativeArraySizeException if <code>indent < 0</code>
776      */
777     private static List toLines( String text, int indent, int indentSize, int lineLength )
778     {
779         List lines = new ArrayList();
780 
781         String ind = repeat( "\t", indent );
782         String[] plainLines = text.split( "(\r\n)|(\r)|(\n)" );
783         for ( int i = 0; i < plainLines.length; i++ )
784         {
785             toLines( lines, ind + plainLines[i], indentSize, lineLength );
786         }
787 
788         return lines;
789     }
790 
791     /** 
792      * Adds the specified line to the output sequence, performing line wrapping if necessary.
793      * 
794      * @param lines The sequence of display lines, must not be <code>null</code>.
795      * @param line The line to add, must not be <code>null</code>.
796      * @param indentSize The size of each indentation, must not be negative.
797      * @param lineLength The length of the line, must not be negative.
798      */
799     private static void toLines( List lines, String line, int indentSize, int lineLength )
800     {
801         int lineIndent = getIndentLevel( line );
802         StringBuffer buf = new StringBuffer( 256 );
803         String[] tokens = line.split( " +" );
804         for ( int i = 0; i < tokens.length; i++ )
805         {
806             String token = tokens[i];
807             if ( i > 0 )
808             {
809                 if ( buf.length() + token.length() >= lineLength )
810                 {
811                     lines.add( buf.toString() );
812                     buf.setLength( 0 );
813                     buf.append( repeat( " ", lineIndent * indentSize ) );
814                 }
815                 else
816                 {
817                     buf.append( ' ' );
818                 }
819             }
820             for ( int j = 0; j < token.length(); j++ )
821             {
822                 char c = token.charAt( j );
823                 if ( c == '\t' )
824                 {
825                     buf.append( repeat( " ", indentSize - buf.length() % indentSize ) );
826                 }
827                 else if ( c == '\u00A0' )
828                 {
829                     buf.append( ' ' );
830                 }
831                 else
832                 {
833                     buf.append( c );
834                 }
835             }
836         }
837         lines.add( buf.toString() );
838     }
839 
840     /** 
841      * Gets the indentation level of the specified line.
842      * 
843      * @param line The line whose indentation level should be retrieved, must not be <code>null</code>.
844      * @return The indentation level of the line.
845      */
846     private static int getIndentLevel( String line )
847     {
848         int level = 0;
849         for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ )
850         {
851             level++;
852         }
853         for ( int i = level + 1; i <= level + 4 && i < line.length(); i++ )
854         {
855             if ( line.charAt( i ) == '\t' )
856             {
857                 level++;
858                 break;
859             }
860         }
861         return level;
862     }
863 }