Coverage Report - org.apache.maven.plugins.site.HelpMojo
 
Classes in this File Line Coverage Branch Coverage Complexity
HelpMojo
0%
0/452
0%
0/102
9,5
 
 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 Dec 17 22:30:42 CET 2009
 14  
  * @author org.apache.maven.tools.plugin.generator.PluginHelpGenerator (version 2.5.1)
 15  
  * @goal help
 16  
  * @requiresProject false
 17  
  */
 18  0
 public class HelpMojo
 19  
     extends AbstractMojo
 20  
 {
 21  
     /**
 22  
      * If <code>true</code>, display all settable properties for each goal.
 23  
      * 
 24  
      * @parameter expression="${detail}" default-value="false"
 25  
      */
 26  
     private boolean detail;
 27  
 
 28  
     /**
 29  
      * The name of the goal for which to show help. If unspecified, all goals will be displayed.
 30  
      * 
 31  
      * @parameter expression="${goal}"
 32  
      */
 33  
     private java.lang.String goal;
 34  
 
 35  
     /**
 36  
      * The maximum length of a display line, should be positive.
 37  
      * 
 38  
      * @parameter expression="${lineLength}" default-value="80"
 39  
      */
 40  
     private int lineLength;
 41  
 
 42  
     /**
 43  
      * The number of spaces per indentation level, should be positive.
 44  
      * 
 45  
      * @parameter expression="${indentSize}" default-value="2"
 46  
      */
 47  
     private int indentSize;
 48  
 
 49  
 
 50  
     /** {@inheritDoc} */
 51  
     public void execute()
 52  
         throws MojoExecutionException
 53  
     {
 54  0
         if ( lineLength <= 0 )
 55  
         {
 56  0
             getLog().warn( "The parameter 'lineLength' should be positive, using '80' as default." );
 57  0
             lineLength = 80;
 58  
         }
 59  0
         if ( indentSize <= 0 )
 60  
         {
 61  0
             getLog().warn( "The parameter 'indentSize' should be positive, using '2' as default." );
 62  0
             indentSize = 2;
 63  
         }
 64  
 
 65  0
         StringBuffer sb = new StringBuffer();
 66  
 
 67  0
         append( sb, "org.apache.maven.plugins:maven-site-plugin:2.1", 0 );
 68  0
         append( sb, "", 0 );
 69  
 
 70  0
         append( sb, "Maven Site Plugin", 0 );
 71  0
         append( sb, "The Maven Site Plugin is a plugin that generates a site for the current project.", 1 );
 72  0
         append( sb, "", 0 );
 73  
 
 74  0
         if ( goal == null || goal.length() <= 0 )
 75  
         {
 76  0
             append( sb, "This plugin has 8 goals:", 0 );
 77  0
             append( sb, "", 0 );
 78  
         }
 79  
 
 80  0
         if ( goal == null || goal.length() <= 0 || "attach-descriptor".equals( goal ) )
 81  
         {
 82  0
             append( sb, "site:attach-descriptor", 0 );
 83  0
             append( sb, "Adds the site descriptor (site.xml) to the list of files to be installed/deployed.", 1 );
 84  0
             append( sb, "", 0 );
 85  0
             if ( detail )
 86  
             {
 87  0
                 append( sb, "Available parameters:", 1 );
 88  0
                 append( sb, "", 0 );
 89  
 
 90  0
                 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
 91  0
                 append( sb, "Specifies the input encoding.", 3 );
 92  0
                 append( sb, "", 0 );
 93  
 
 94  0
                 append( sb, "locales", 2 );
 95  0
                 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 );
 96  0
                 append( sb, "", 0 );
 97  
 
 98  0
                 append( sb, "localRepository", 2 );
 99  0
                 append( sb, "The local repository.", 3 );
 100  0
                 append( sb, "", 0 );
 101  
 
 102  0
                 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
 103  0
                 append( sb, "Specifies the output encoding.", 3 );
 104  0
                 append( sb, "", 0 );
 105  
 
 106  0
                 append( sb, "siteDirectory", 2 );
 107  0
                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
 108  0
                 append( sb, "", 0 );
 109  
             }
 110  
         }
 111  
 
 112  0
         if ( goal == null || goal.length() <= 0 || "deploy".equals( goal ) )
 113  
         {
 114  0
             append( sb, "site:deploy", 0 );
 115  0
             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 );
 116  0
             append( sb, "", 0 );
 117  0
             if ( detail )
 118  
             {
 119  0
                 append( sb, "Available parameters:", 1 );
 120  0
                 append( sb, "", 0 );
 121  
 
 122  0
                 append( sb, "chmod (Default: true)", 2 );
 123  0
                 append( sb, "Whether to run the \'chmod\' command on the remote site after the deploy. Defaults to \'true\'.", 3 );
 124  0
                 append( sb, "", 0 );
 125  
 
 126  0
                 append( sb, "chmodMode (Default: g+w,a+rX)", 2 );
 127  0
                 append( sb, "The mode used by the \'chmod\' command. Only used if chmod = true. Defaults to \'g+w,a+rX\'.", 3 );
 128  0
                 append( sb, "", 0 );
 129  
 
 130  0
                 append( sb, "chmodOptions (Default: -Rf)", 2 );
 131  0
                 append( sb, "The options used by the \'chmod\' command. Only used if chmod = true. Defaults to \'-Rf\'.", 3 );
 132  0
                 append( sb, "", 0 );
 133  
 
 134  0
                 append( sb, "inputDirectory", 2 );
 135  0
                 append( sb, "Directory containing the generated project sites and report distributions.", 3 );
 136  0
                 append( sb, "", 0 );
 137  
             }
 138  
         }
 139  
 
 140  0
         if ( goal == null || goal.length() <= 0 || "help".equals( goal ) )
 141  
         {
 142  0
             append( sb, "site:help", 0 );
 143  0
             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 );
 144  0
             append( sb, "", 0 );
 145  0
             if ( detail )
 146  
             {
 147  0
                 append( sb, "Available parameters:", 1 );
 148  0
                 append( sb, "", 0 );
 149  
 
 150  0
                 append( sb, "detail (Default: false)", 2 );
 151  0
                 append( sb, "If true, display all settable properties for each goal.", 3 );
 152  0
                 append( sb, "", 0 );
 153  
 
 154  0
                 append( sb, "goal", 2 );
 155  0
                 append( sb, "The name of the goal for which to show help. If unspecified, all goals will be displayed.", 3 );
 156  0
                 append( sb, "", 0 );
 157  
 
 158  0
                 append( sb, "indentSize (Default: 2)", 2 );
 159  0
                 append( sb, "The number of spaces per indentation level, should be positive.", 3 );
 160  0
                 append( sb, "", 0 );
 161  
 
 162  0
                 append( sb, "lineLength (Default: 80)", 2 );
 163  0
                 append( sb, "The maximum length of a display line, should be positive.", 3 );
 164  0
                 append( sb, "", 0 );
 165  
             }
 166  
         }
 167  
 
 168  0
         if ( goal == null || goal.length() <= 0 || "jar".equals( goal ) )
 169  
         {
 170  0
             append( sb, "site:jar", 0 );
 171  0
             append( sb, "Bundles the site output into a JAR so that it can be deployed to a repository.", 1 );
 172  0
             append( sb, "", 0 );
 173  0
             if ( detail )
 174  
             {
 175  0
                 append( sb, "Available parameters:", 1 );
 176  0
                 append( sb, "", 0 );
 177  
 
 178  0
                 append( sb, "attach (Default: true)", 2 );
 179  0
                 append( sb, "Specifies whether to attach the generated artifact to the project.", 3 );
 180  0
                 append( sb, "", 0 );
 181  
 
 182  0
                 append( sb, "attributes", 2 );
 183  0
                 append( sb, "The template properties for rendering the site.", 3 );
 184  0
                 append( sb, "", 0 );
 185  
 
 186  0
                 append( sb, "finalName", 2 );
 187  0
                 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 );
 188  0
                 append( sb, "", 0 );
 189  
 
 190  0
                 append( sb, "generatedSiteDirectory", 2 );
 191  0
                 append( sb, "Directory containing generated documentation.", 3 );
 192  0
                 append( sb, "", 0 );
 193  
 
 194  0
                 append( sb, "generateReports (Default: true)", 2 );
 195  0
                 append( sb, "Convenience parameter that allows you to disable report generation.", 3 );
 196  0
                 append( sb, "", 0 );
 197  
 
 198  0
                 append( sb, "generateSitemap (Default: false)", 2 );
 199  0
                 append( sb, "Generate a sitemap. The result will be a \'sitemap.html\' file at the site root.", 3 );
 200  0
                 append( sb, "", 0 );
 201  
 
 202  0
                 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
 203  0
                 append( sb, "Specifies the input encoding.", 3 );
 204  0
                 append( sb, "", 0 );
 205  
 
 206  0
                 append( sb, "jarOutputDirectory", 2 );
 207  0
                 append( sb, "Specifies the directory where the generated jar file will be put.", 3 );
 208  0
                 append( sb, "", 0 );
 209  
 
 210  0
                 append( sb, "locales", 2 );
 211  0
                 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 );
 212  0
                 append( sb, "", 0 );
 213  
 
 214  0
                 append( sb, "localRepository", 2 );
 215  0
                 append( sb, "The local repository.", 3 );
 216  0
                 append( sb, "", 0 );
 217  
 
 218  0
                 append( sb, "moduleExcludes", 2 );
 219  0
                 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 );
 220  0
                 append( sb, "", 0 );
 221  
 
 222  0
                 append( sb, "outputDirectory (Default: ${project.reporting.outputDirectory})", 2 );
 223  0
                 append( sb, "Directory containing the generated project sites and report distributions.", 3 );
 224  0
                 append( sb, "", 0 );
 225  
 
 226  0
                 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
 227  0
                 append( sb, "Specifies the output encoding.", 3 );
 228  0
                 append( sb, "", 0 );
 229  
 
 230  0
                 append( sb, "repositories", 2 );
 231  0
                 append( sb, "Remote repositories used for the project.", 3 );
 232  0
                 append( sb, "", 0 );
 233  
 
 234  0
                 append( sb, "siteDirectory", 2 );
 235  0
                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
 236  0
                 append( sb, "", 0 );
 237  
 
 238  0
                 append( sb, "template", 2 );
 239  0
                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
 240  0
                 append( sb, "", 0 );
 241  0
                 append( sb, "Default template page.", 3 );
 242  0
                 append( sb, "", 0 );
 243  
 
 244  0
                 append( sb, "templateDirectory (Default: src/site)", 2 );
 245  0
                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
 246  0
                 append( sb, "", 0 );
 247  0
                 append( sb, "Directory containing the template page.", 3 );
 248  0
                 append( sb, "", 0 );
 249  
 
 250  0
                 append( sb, "templateFile", 2 );
 251  0
                 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 );
 252  0
                 append( sb, "", 0 );
 253  
 
 254  0
                 append( sb, "xdocDirectory (Default: ${basedir}/xdocs)", 2 );
 255  0
                 append( sb, "Deprecated. use the standard m2 directory layout", 3 );
 256  0
                 append( sb, "", 0 );
 257  0
                 append( sb, "Alternative directory for xdoc source, useful for m1 to m2 migration", 3 );
 258  0
                 append( sb, "", 0 );
 259  
             }
 260  
         }
 261  
 
 262  0
         if ( goal == null || goal.length() <= 0 || "run".equals( goal ) )
 263  
         {
 264  0
             append( sb, "site:run", 0 );
 265  0
             append( sb, "Starts the site up, rendering documents as requested for faster editing. It uses Jetty as the web server.", 1 );
 266  0
             append( sb, "", 0 );
 267  0
             if ( detail )
 268  
             {
 269  0
                 append( sb, "Available parameters:", 1 );
 270  0
                 append( sb, "", 0 );
 271  
 
 272  0
                 append( sb, "attributes", 2 );
 273  0
                 append( sb, "The template properties for rendering the site.", 3 );
 274  0
                 append( sb, "", 0 );
 275  
 
 276  0
                 append( sb, "generatedSiteDirectory", 2 );
 277  0
                 append( sb, "Directory containing generated documentation.", 3 );
 278  0
                 append( sb, "", 0 );
 279  
 
 280  0
                 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
 281  0
                 append( sb, "Specifies the input encoding.", 3 );
 282  0
                 append( sb, "", 0 );
 283  
 
 284  0
                 append( sb, "locales", 2 );
 285  0
                 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 );
 286  0
                 append( sb, "", 0 );
 287  
 
 288  0
                 append( sb, "localRepository", 2 );
 289  0
                 append( sb, "The local repository.", 3 );
 290  0
                 append( sb, "", 0 );
 291  
 
 292  0
                 append( sb, "moduleExcludes", 2 );
 293  0
                 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 );
 294  0
                 append( sb, "", 0 );
 295  
 
 296  0
                 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
 297  0
                 append( sb, "Specifies the output encoding.", 3 );
 298  0
                 append( sb, "", 0 );
 299  
 
 300  0
                 append( sb, "port (Default: 8080)", 2 );
 301  0
                 append( sb, "The port to execute the HTTP server on.", 3 );
 302  0
                 append( sb, "", 0 );
 303  
 
 304  0
                 append( sb, "repositories", 2 );
 305  0
                 append( sb, "Remote repositories used for the project.", 3 );
 306  0
                 append( sb, "", 0 );
 307  
 
 308  0
                 append( sb, "siteDirectory", 2 );
 309  0
                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
 310  0
                 append( sb, "", 0 );
 311  
 
 312  0
                 append( sb, "template", 2 );
 313  0
                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
 314  0
                 append( sb, "", 0 );
 315  0
                 append( sb, "Default template page.", 3 );
 316  0
                 append( sb, "", 0 );
 317  
 
 318  0
                 append( sb, "templateDirectory (Default: src/site)", 2 );
 319  0
                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
 320  0
                 append( sb, "", 0 );
 321  0
                 append( sb, "Directory containing the template page.", 3 );
 322  0
                 append( sb, "", 0 );
 323  
 
 324  0
                 append( sb, "templateFile", 2 );
 325  0
                 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 );
 326  0
                 append( sb, "", 0 );
 327  
 
 328  0
                 append( sb, "tempWebappDirectory", 2 );
 329  0
                 append( sb, "Where to create the dummy web application.", 3 );
 330  0
                 append( sb, "", 0 );
 331  
 
 332  0
                 append( sb, "xdocDirectory (Default: ${basedir}/xdocs)", 2 );
 333  0
                 append( sb, "Deprecated. use the standard m2 directory layout", 3 );
 334  0
                 append( sb, "", 0 );
 335  0
                 append( sb, "Alternative directory for xdoc source, useful for m1 to m2 migration", 3 );
 336  0
                 append( sb, "", 0 );
 337  
             }
 338  
         }
 339  
 
 340  0
         if ( goal == null || goal.length() <= 0 || "site".equals( goal ) )
 341  
         {
 342  0
             append( sb, "site:site", 0 );
 343  0
             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 );
 344  0
             append( sb, "", 0 );
 345  0
             if ( detail )
 346  
             {
 347  0
                 append( sb, "Available parameters:", 1 );
 348  0
                 append( sb, "", 0 );
 349  
 
 350  0
                 append( sb, "attributes", 2 );
 351  0
                 append( sb, "The template properties for rendering the site.", 3 );
 352  0
                 append( sb, "", 0 );
 353  
 
 354  0
                 append( sb, "generatedSiteDirectory", 2 );
 355  0
                 append( sb, "Directory containing generated documentation.", 3 );
 356  0
                 append( sb, "", 0 );
 357  
 
 358  0
                 append( sb, "generateReports (Default: true)", 2 );
 359  0
                 append( sb, "Convenience parameter that allows you to disable report generation.", 3 );
 360  0
                 append( sb, "", 0 );
 361  
 
 362  0
                 append( sb, "generateSitemap (Default: false)", 2 );
 363  0
                 append( sb, "Generate a sitemap. The result will be a \'sitemap.html\' file at the site root.", 3 );
 364  0
                 append( sb, "", 0 );
 365  
 
 366  0
                 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
 367  0
                 append( sb, "Specifies the input encoding.", 3 );
 368  0
                 append( sb, "", 0 );
 369  
 
 370  0
                 append( sb, "locales", 2 );
 371  0
                 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 );
 372  0
                 append( sb, "", 0 );
 373  
 
 374  0
                 append( sb, "localRepository", 2 );
 375  0
                 append( sb, "The local repository.", 3 );
 376  0
                 append( sb, "", 0 );
 377  
 
 378  0
                 append( sb, "moduleExcludes", 2 );
 379  0
                 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 );
 380  0
                 append( sb, "", 0 );
 381  
 
 382  0
                 append( sb, "outputDirectory (Default: ${project.reporting.outputDirectory})", 2 );
 383  0
                 append( sb, "Directory containing the generated project sites and report distributions.", 3 );
 384  0
                 append( sb, "", 0 );
 385  
 
 386  0
                 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
 387  0
                 append( sb, "Specifies the output encoding.", 3 );
 388  0
                 append( sb, "", 0 );
 389  
 
 390  0
                 append( sb, "repositories", 2 );
 391  0
                 append( sb, "Remote repositories used for the project.", 3 );
 392  0
                 append( sb, "", 0 );
 393  
 
 394  0
                 append( sb, "siteDirectory", 2 );
 395  0
                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
 396  0
                 append( sb, "", 0 );
 397  
 
 398  0
                 append( sb, "template", 2 );
 399  0
                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
 400  0
                 append( sb, "", 0 );
 401  0
                 append( sb, "Default template page.", 3 );
 402  0
                 append( sb, "", 0 );
 403  
 
 404  0
                 append( sb, "templateDirectory (Default: src/site)", 2 );
 405  0
                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
 406  0
                 append( sb, "", 0 );
 407  0
                 append( sb, "Directory containing the template page.", 3 );
 408  0
                 append( sb, "", 0 );
 409  
 
 410  0
                 append( sb, "templateFile", 2 );
 411  0
                 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 );
 412  0
                 append( sb, "", 0 );
 413  
 
 414  0
                 append( sb, "xdocDirectory (Default: ${basedir}/xdocs)", 2 );
 415  0
                 append( sb, "Deprecated. use the standard m2 directory layout", 3 );
 416  0
                 append( sb, "", 0 );
 417  0
                 append( sb, "Alternative directory for xdoc source, useful for m1 to m2 migration", 3 );
 418  0
                 append( sb, "", 0 );
 419  
             }
 420  
         }
 421  
 
 422  0
         if ( goal == null || goal.length() <= 0 || "stage".equals( goal ) )
 423  
         {
 424  0
             append( sb, "site:stage", 0 );
 425  0
             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 );
 426  0
             append( sb, "", 0 );
 427  0
             if ( detail )
 428  
             {
 429  0
                 append( sb, "Available parameters:", 1 );
 430  0
                 append( sb, "", 0 );
 431  
 
 432  0
                 append( sb, "attributes", 2 );
 433  0
                 append( sb, "The template properties for rendering the site.", 3 );
 434  0
                 append( sb, "", 0 );
 435  
 
 436  0
                 append( sb, "generatedSiteDirectory", 2 );
 437  0
                 append( sb, "Directory containing generated documentation.", 3 );
 438  0
                 append( sb, "", 0 );
 439  
 
 440  0
                 append( sb, "generateReports (Default: true)", 2 );
 441  0
                 append( sb, "Convenience parameter that allows you to disable report generation.", 3 );
 442  0
                 append( sb, "", 0 );
 443  
 
 444  0
                 append( sb, "generateSitemap (Default: false)", 2 );
 445  0
                 append( sb, "Generate a sitemap. The result will be a \'sitemap.html\' file at the site root.", 3 );
 446  0
                 append( sb, "", 0 );
 447  
 
 448  0
                 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
 449  0
                 append( sb, "Specifies the input encoding.", 3 );
 450  0
                 append( sb, "", 0 );
 451  
 
 452  0
                 append( sb, "locales", 2 );
 453  0
                 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 );
 454  0
                 append( sb, "", 0 );
 455  
 
 456  0
                 append( sb, "localRepository", 2 );
 457  0
                 append( sb, "The local repository.", 3 );
 458  0
                 append( sb, "", 0 );
 459  
 
 460  0
                 append( sb, "moduleExcludes", 2 );
 461  0
                 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 );
 462  0
                 append( sb, "", 0 );
 463  
 
 464  0
                 append( sb, "outputDirectory (Default: ${project.reporting.outputDirectory})", 2 );
 465  0
                 append( sb, "Directory containing the generated project sites and report distributions.", 3 );
 466  0
                 append( sb, "", 0 );
 467  
 
 468  0
                 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
 469  0
                 append( sb, "Specifies the output encoding.", 3 );
 470  0
                 append( sb, "", 0 );
 471  
 
 472  0
                 append( sb, "repositories", 2 );
 473  0
                 append( sb, "Remote repositories used for the project.", 3 );
 474  0
                 append( sb, "", 0 );
 475  
 
 476  0
                 append( sb, "siteDirectory", 2 );
 477  0
                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
 478  0
                 append( sb, "", 0 );
 479  
 
 480  0
                 append( sb, "stagingDirectory", 2 );
 481  0
                 append( sb, "Staging directory location. This needs to be an absolute path, like C:\\stagingArea\\myProject\\ on Windows or /stagingArea/myProject/ on Unix.", 3 );
 482  0
                 append( sb, "", 0 );
 483  
 
 484  0
                 append( sb, "template", 2 );
 485  0
                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
 486  0
                 append( sb, "", 0 );
 487  0
                 append( sb, "Default template page.", 3 );
 488  0
                 append( sb, "", 0 );
 489  
 
 490  0
                 append( sb, "templateDirectory (Default: src/site)", 2 );
 491  0
                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
 492  0
                 append( sb, "", 0 );
 493  0
                 append( sb, "Directory containing the template page.", 3 );
 494  0
                 append( sb, "", 0 );
 495  
 
 496  0
                 append( sb, "templateFile", 2 );
 497  0
                 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 );
 498  0
                 append( sb, "", 0 );
 499  
 
 500  0
                 append( sb, "xdocDirectory (Default: ${basedir}/xdocs)", 2 );
 501  0
                 append( sb, "Deprecated. use the standard m2 directory layout", 3 );
 502  0
                 append( sb, "", 0 );
 503  0
                 append( sb, "Alternative directory for xdoc source, useful for m1 to m2 migration", 3 );
 504  0
                 append( sb, "", 0 );
 505  
             }
 506  
         }
 507  
 
 508  0
         if ( goal == null || goal.length() <= 0 || "stage-deploy".equals( goal ) )
 509  
         {
 510  0
             append( sb, "site:stage-deploy", 0 );
 511  0
             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 );
 512  0
             append( sb, "", 0 );
 513  0
             if ( detail )
 514  
             {
 515  0
                 append( sb, "Available parameters:", 1 );
 516  0
                 append( sb, "", 0 );
 517  
 
 518  0
                 append( sb, "attributes", 2 );
 519  0
                 append( sb, "The template properties for rendering the site.", 3 );
 520  0
                 append( sb, "", 0 );
 521  
 
 522  0
                 append( sb, "chmod (Default: true)", 2 );
 523  0
                 append( sb, "Whether to run the \'chmod\' command on the remote site after the deploy. Defaults to \'true\'.", 3 );
 524  0
                 append( sb, "", 0 );
 525  
 
 526  0
                 append( sb, "chmodMode (Default: g+w,a+rX)", 2 );
 527  0
                 append( sb, "The mode used by the \'chmod\' command. Only used if chmod = true. Defaults to \'g+w,a+rX\'.", 3 );
 528  0
                 append( sb, "", 0 );
 529  
 
 530  0
                 append( sb, "chmodOptions (Default: -Rf)", 2 );
 531  0
                 append( sb, "The options used by the \'chmod\' command. Only used if chmod = true. Defaults to \'-Rf\'.", 3 );
 532  0
                 append( sb, "", 0 );
 533  
 
 534  0
                 append( sb, "generatedSiteDirectory", 2 );
 535  0
                 append( sb, "Directory containing generated documentation.", 3 );
 536  0
                 append( sb, "", 0 );
 537  
 
 538  0
                 append( sb, "generateReports (Default: true)", 2 );
 539  0
                 append( sb, "Convenience parameter that allows you to disable report generation.", 3 );
 540  0
                 append( sb, "", 0 );
 541  
 
 542  0
                 append( sb, "generateSitemap (Default: false)", 2 );
 543  0
                 append( sb, "Generate a sitemap. The result will be a \'sitemap.html\' file at the site root.", 3 );
 544  0
                 append( sb, "", 0 );
 545  
 
 546  0
                 append( sb, "inputEncoding (Default: ${project.build.sourceEncoding})", 2 );
 547  0
                 append( sb, "Specifies the input encoding.", 3 );
 548  0
                 append( sb, "", 0 );
 549  
 
 550  0
                 append( sb, "locales", 2 );
 551  0
                 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 );
 552  0
                 append( sb, "", 0 );
 553  
 
 554  0
                 append( sb, "localRepository", 2 );
 555  0
                 append( sb, "The local repository.", 3 );
 556  0
                 append( sb, "", 0 );
 557  
 
 558  0
                 append( sb, "moduleExcludes", 2 );
 559  0
                 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 );
 560  0
                 append( sb, "", 0 );
 561  
 
 562  0
                 append( sb, "outputDirectory (Default: ${project.reporting.outputDirectory})", 2 );
 563  0
                 append( sb, "Directory containing the generated project sites and report distributions.", 3 );
 564  0
                 append( sb, "", 0 );
 565  
 
 566  0
                 append( sb, "outputEncoding (Default: ${project.reporting.outputEncoding})", 2 );
 567  0
                 append( sb, "Specifies the output encoding.", 3 );
 568  0
                 append( sb, "", 0 );
 569  
 
 570  0
                 append( sb, "repositories", 2 );
 571  0
                 append( sb, "Remote repositories used for the project.", 3 );
 572  0
                 append( sb, "", 0 );
 573  
 
 574  0
                 append( sb, "siteDirectory", 2 );
 575  0
                 append( sb, "Directory containing the site.xml file and the source for apt, fml and xdoc docs.", 3 );
 576  0
                 append( sb, "", 0 );
 577  
 
 578  0
                 append( sb, "stagingDirectory", 2 );
 579  0
                 append( sb, "Staging directory location. This needs to be an absolute path, like C:\\stagingArea\\myProject\\ on Windows or /stagingArea/myProject/ on Unix.", 3 );
 580  0
                 append( sb, "", 0 );
 581  
 
 582  0
                 append( sb, "stagingRepositoryId (Default: stagingSite)", 2 );
 583  0
                 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.", 3 );
 584  0
                 append( sb, "", 0 );
 585  
 
 586  0
                 append( sb, "stagingSiteURL", 2 );
 587  0
                 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.", 3 );
 588  0
                 append( sb, "", 0 );
 589  
 
 590  0
                 append( sb, "template", 2 );
 591  0
                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
 592  0
                 append( sb, "", 0 );
 593  0
                 append( sb, "Default template page.", 3 );
 594  0
                 append( sb, "", 0 );
 595  
 
 596  0
                 append( sb, "templateDirectory (Default: src/site)", 2 );
 597  0
                 append( sb, "Deprecated. use templateFile or skinning instead", 3 );
 598  0
                 append( sb, "", 0 );
 599  0
                 append( sb, "Directory containing the template page.", 3 );
 600  0
                 append( sb, "", 0 );
 601  
 
 602  0
                 append( sb, "templateFile", 2 );
 603  0
                 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 );
 604  0
                 append( sb, "", 0 );
 605  
 
 606  0
                 append( sb, "xdocDirectory (Default: ${basedir}/xdocs)", 2 );
 607  0
                 append( sb, "Deprecated. use the standard m2 directory layout", 3 );
 608  0
                 append( sb, "", 0 );
 609  0
                 append( sb, "Alternative directory for xdoc source, useful for m1 to m2 migration", 3 );
 610  0
                 append( sb, "", 0 );
 611  
             }
 612  
         }
 613  
 
 614  0
         if ( getLog().isInfoEnabled() )
 615  
         {
 616  0
             getLog().info( sb.toString() );
 617  
         }
 618  0
     }
 619  
 
 620  
     /**
 621  
      * <p>Repeat a String <code>n</code> times to form a new string.</p>
 622  
      *
 623  
      * @param str String to repeat
 624  
      * @param repeat number of times to repeat str
 625  
      * @return String with repeated String
 626  
      * @throws NegativeArraySizeException if <code>repeat < 0</code>
 627  
      * @throws NullPointerException if str is <code>null</code>
 628  
      */
 629  
     private static String repeat( String str, int repeat )
 630  
     {
 631  0
         StringBuffer buffer = new StringBuffer( repeat * str.length() );
 632  
 
 633  0
         for ( int i = 0; i < repeat; i++ )
 634  
         {
 635  0
             buffer.append( str );
 636  
         }
 637  
 
 638  0
         return buffer.toString();
 639  
     }
 640  
 
 641  
     /** 
 642  
      * Append a description to the buffer by respecting the indentSize and lineLength parameters.
 643  
      * <b>Note</b>: The last character is always a new line.
 644  
      * 
 645  
      * @param sb The buffer to append the description, not <code>null</code>.
 646  
      * @param description The description, not <code>null</code>.
 647  
      * @param indent The base indentation level of each line, must not be negative.
 648  
      */
 649  
     private void append( StringBuffer sb, String description, int indent )
 650  
     {
 651  0
         for ( Iterator it = toLines( description, indent, indentSize, lineLength ).iterator(); it.hasNext(); )
 652  
         {
 653  0
             sb.append( it.next().toString() ).append( '\n' );
 654  
         }
 655  0
     }
 656  
 
 657  
     /** 
 658  
      * Splits the specified text into lines of convenient display length.
 659  
      * 
 660  
      * @param text The text to split into lines, must not be <code>null</code>.
 661  
      * @param indent The base indentation level of each line, must not be negative.
 662  
      * @param indentSize The size of each indentation, must not be negative.
 663  
      * @param lineLength The length of the line, must not be negative.
 664  
      * @return The sequence of display lines, never <code>null</code>.
 665  
      * @throws NegativeArraySizeException if <code>indent < 0</code>
 666  
      */
 667  
     private static List toLines( String text, int indent, int indentSize, int lineLength )
 668  
     {
 669  0
         List lines = new ArrayList();
 670  
 
 671  0
         String ind = repeat( "\t", indent );
 672  0
         String[] plainLines = text.split( "(\r\n)|(\r)|(\n)" );
 673  0
         for ( int i = 0; i < plainLines.length; i++ )
 674  
         {
 675  0
             toLines( lines, ind + plainLines[i], indentSize, lineLength );
 676  
         }
 677  
 
 678  0
         return lines;
 679  
     }
 680  
 
 681  
     /** 
 682  
      * Adds the specified line to the output sequence, performing line wrapping if necessary.
 683  
      * 
 684  
      * @param lines The sequence of display lines, must not be <code>null</code>.
 685  
      * @param line The line to add, must not be <code>null</code>.
 686  
      * @param indentSize The size of each indentation, must not be negative.
 687  
      * @param lineLength The length of the line, must not be negative.
 688  
      */
 689  
     private static void toLines( List lines, String line, int indentSize, int lineLength )
 690  
     {
 691  0
         int lineIndent = getIndentLevel( line );
 692  0
         StringBuffer buf = new StringBuffer( 256 );
 693  0
         String[] tokens = line.split( " +" );
 694  0
         for ( int i = 0; i < tokens.length; i++ )
 695  
         {
 696  0
             String token = tokens[i];
 697  0
             if ( i > 0 )
 698  
             {
 699  0
                 if ( buf.length() + token.length() >= lineLength )
 700  
                 {
 701  0
                     lines.add( buf.toString() );
 702  0
                     buf.setLength( 0 );
 703  0
                     buf.append( repeat( " ", lineIndent * indentSize ) );
 704  
                 }
 705  
                 else
 706  
                 {
 707  0
                     buf.append( ' ' );
 708  
                 }
 709  
             }
 710  0
             for ( int j = 0; j < token.length(); j++ )
 711  
             {
 712  0
                 char c = token.charAt( j );
 713  0
                 if ( c == '\t' )
 714  
                 {
 715  0
                     buf.append( repeat( " ", indentSize - buf.length() % indentSize ) );
 716  
                 }
 717  0
                 else if ( c == '\u00A0' )
 718  
                 {
 719  0
                     buf.append( ' ' );
 720  
                 }
 721  
                 else
 722  
                 {
 723  0
                     buf.append( c );
 724  
                 }
 725  
             }
 726  
         }
 727  0
         lines.add( buf.toString() );
 728  0
     }
 729  
 
 730  
     /** 
 731  
      * Gets the indentation level of the specified line.
 732  
      * 
 733  
      * @param line The line whose indentation level should be retrieved, must not be <code>null</code>.
 734  
      * @return The indentation level of the line.
 735  
      */
 736  
     private static int getIndentLevel( String line )
 737  
     {
 738  0
         int level = 0;
 739  0
         for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ )
 740  
         {
 741  0
             level++;
 742  
         }
 743  0
         for ( int i = level + 1; i <= level + 4 && i < line.length(); i++ )
 744  
         {
 745  0
             if ( line.charAt( i ) == '\t' )
 746  
             {
 747  0
                 level++;
 748  0
                 break;
 749  
             }
 750  
         }
 751  0
         return level;
 752  
     }
 753  
 }