Coverage Report - org.apache.maven.plugin.changes.HelpMojo
 
Classes in this File Line Coverage Branch Coverage Complexity
HelpMojo
0%
0/324
0%
0/94
8,833
 
 1  
 package org.apache.maven.plugin.changes;
 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-changes-plugin.<br/> Call <pre>  mvn changes:help -Ddetail=true -Dgoal=&lt;goal-name&gt;</pre> to display parameter details.
 12  
  *
 13  
  * @version generated on Thu Dec 03 19:52:14 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-changes-plugin:2.3", 0 );
 68  0
         append( sb, "", 0 );
 69  
 
 70  0
         append( sb, "Maven Changes Report Plugin", 0 );
 71  0
         append( sb, "Creates a release history for inclusion into the site and assists in generating an announcement mail.", 1 );
 72  0
         append( sb, "", 0 );
 73  
 
 74  0
         if ( goal == null || goal.length() <= 0 )
 75  
         {
 76  0
             append( sb, "This plugin has 7 goals:", 0 );
 77  0
             append( sb, "", 0 );
 78  
         }
 79  
 
 80  0
         if ( goal == null || goal.length() <= 0 || "announcement-generate".equals( goal ) )
 81  
         {
 82  0
             append( sb, "changes:announcement-generate", 0 );
 83  0
             append( sb, "Goal which generate the template for an announcement.", 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, "announceParameters", 2 );
 91  0
                 append( sb, "Map of custom parameters for the announcement. This Map will be passed to the template.", 3 );
 92  0
                 append( sb, "", 0 );
 93  
 
 94  0
                 append( sb, "basedir", 2 );
 95  0
                 append( sb, "The current project base directory.", 3 );
 96  0
                 append( sb, "", 0 );
 97  
 
 98  0
                 append( sb, "developmentTeam (Default: ${project.name} team)", 2 );
 99  0
                 append( sb, "Name of the team that develops the artifact. This parameter will be passed to the template.", 3 );
 100  0
                 append( sb, "", 0 );
 101  
 
 102  0
                 append( sb, "finalName (Default: ${project.build.finalName})", 2 );
 103  0
                 append( sb, "The name of the artifact to be used in the announcement.", 3 );
 104  0
                 append( sb, "", 0 );
 105  
 
 106  0
                 append( sb, "generateJiraAnnouncement (Default: false)", 2 );
 107  0
                 append( sb, "Flag to determine if the plugin will generate a JIRA announcement.", 3 );
 108  0
                 append( sb, "", 0 );
 109  
 
 110  0
                 append( sb, "introduction (Default: ${project.description})", 2 );
 111  0
                 append( sb, "Short description or introduction of the released artifact. This parameter will be passed to the template.", 3 );
 112  0
                 append( sb, "", 0 );
 113  
 
 114  0
                 append( sb, "jiraMerge (Default: false)", 2 );
 115  0
                 append( sb, "If releases from JIRA should be merged with the releases from a changes.xml file.", 3 );
 116  0
                 append( sb, "", 0 );
 117  
 
 118  0
                 append( sb, "jiraPassword", 2 );
 119  0
                 append( sb, "Defines the JIRA password for authentication into a private JIRA installation.", 3 );
 120  0
                 append( sb, "", 0 );
 121  
 
 122  0
                 append( sb, "jiraUser", 2 );
 123  0
                 append( sb, "Defines the JIRA username for authentication into a private JIRA installation.", 3 );
 124  0
                 append( sb, "", 0 );
 125  
 
 126  0
                 append( sb, "maxEntries (Default: 25)", 2 );
 127  0
                 append( sb, "The maximum number of issues to fetch from JIRA.\nNote: In versions 2.0-beta-3 and earlier this parameter was called \'nbEntries\'.\n", 3 );
 128  0
                 append( sb, "", 0 );
 129  
 
 130  0
                 append( sb, "outputDirectory", 2 );
 131  0
                 append( sb, "Directory where the template file will be generated.", 3 );
 132  0
                 append( sb, "", 0 );
 133  
 
 134  0
                 append( sb, "resolutionIds (Default: Fixed)", 2 );
 135  0
                 append( sb, "Include issues from JIRA with these resolution ids. Multiple resolution ids can be specified as a comma separated list of ids.\nNote: In versions 2.0-beta-3 and earlier this parameter was called \'resolutionId\'.\n", 3 );
 136  0
                 append( sb, "", 0 );
 137  
 
 138  0
                 append( sb, "runOnlyAtExecutionRoot (Default: false)", 2 );
 139  0
                 append( sb, "This will cause the execution to be run only at the top of a given module tree. That is, run in the project contained in the same folder where the mvn execution was launched.", 3 );
 140  0
                 append( sb, "", 0 );
 141  
 
 142  0
                 append( sb, "statusIds (Default: Closed)", 2 );
 143  0
                 append( sb, "Include issues from JIRA with these status ids. Multiple status ids can be specified as a comma separated list of ids.\nNote: In versions 2.0-beta-3 and earlier this parameter was called \'statusId\'.\n", 3 );
 144  0
                 append( sb, "", 0 );
 145  
 
 146  0
                 append( sb, "template (Default: announcement.vm)", 2 );
 147  0
                 append( sb, "The Velocity template used to format the announcement.", 3 );
 148  0
                 append( sb, "", 0 );
 149  
 
 150  0
                 append( sb, "templateDirectory (Default: org/apache/maven/plugin/announcement)", 2 );
 151  0
                 append( sb, "Directory that contains the template.\nNote: This directory must be a subdirectory of /src/main/resources/ or current project base directory.\n", 3 );
 152  0
                 append( sb, "", 0 );
 153  
 
 154  0
                 append( sb, "templateEncoding (Default: ${project.build.sourceEncoding})", 2 );
 155  0
                 append( sb, "The template encoding.", 3 );
 156  0
                 append( sb, "", 0 );
 157  
 
 158  0
                 append( sb, "url", 2 );
 159  0
                 append( sb, "Distribution URL of the artifact. This parameter will be passed to the template.", 3 );
 160  0
                 append( sb, "", 0 );
 161  
 
 162  0
                 append( sb, "urlDownload", 2 );
 163  0
                 append( sb, "URL where the artifact can be downloaded. If not specified, no URL is used. This parameter will be passed to the template.", 3 );
 164  0
                 append( sb, "", 0 );
 165  
 
 166  0
                 append( sb, "version (Default: ${project.version})", 2 );
 167  0
                 append( sb, "Version of the artifact.", 3 );
 168  0
                 append( sb, "", 0 );
 169  
 
 170  0
                 append( sb, "xmlPath", 2 );
 171  0
                 append( sb, "The path of the changes.xml file.", 3 );
 172  0
                 append( sb, "", 0 );
 173  
             }
 174  
         }
 175  
 
 176  0
         if ( goal == null || goal.length() <= 0 || "announcement-mail".equals( goal ) )
 177  
         {
 178  0
             append( sb, "changes:announcement-mail", 0 );
 179  0
             append( sb, "Goal which sends an announcement through email.", 1 );
 180  0
             append( sb, "", 0 );
 181  0
             if ( detail )
 182  
             {
 183  0
                 append( sb, "Available parameters:", 1 );
 184  0
                 append( sb, "", 0 );
 185  
 
 186  0
                 append( sb, "basedir", 2 );
 187  0
                 append( sb, "The current project base directory.", 3 );
 188  0
                 append( sb, "", 0 );
 189  
 
 190  0
                 append( sb, "fromDeveloperId", 2 );
 191  0
                 append( sb, "The id of the developer sending the announcement mail. Only used if the mailSender attribute is not set. In this case, this should match the id of one of the developers in the pom. If a matching developer is not found, then the first developer in the pom will be used.", 3 );
 192  0
                 append( sb, "", 0 );
 193  
 
 194  0
                 append( sb, "mailContentType (Default: text/plain)", 2 );
 195  0
                 append( sb, "Mail content type to use.", 3 );
 196  0
                 append( sb, "", 0 );
 197  
 
 198  0
                 append( sb, "mailSender", 2 );
 199  0
                 append( sb, "Defines the sender of the announcement if the list of developer is empty or if the sender is not a member of the development team.", 3 );
 200  0
                 append( sb, "", 0 );
 201  
 
 202  0
                 append( sb, "password", 2 );
 203  0
                 append( sb, "The password used to send the email.", 3 );
 204  0
                 append( sb, "", 0 );
 205  
 
 206  0
                 append( sb, "runOnlyAtExecutionRoot (Default: false)", 2 );
 207  0
                 append( sb, "This will cause the execution to be run only at the top of a given module tree. That is, run in the project contained in the same folder where the mvn execution was launched.", 3 );
 208  0
                 append( sb, "", 0 );
 209  
 
 210  0
                 append( sb, "smtpHost", 2 );
 211  0
                 append( sb, "Smtp Server.", 3 );
 212  0
                 append( sb, "", 0 );
 213  
 
 214  0
                 append( sb, "smtpPort (Default: 25)", 2 );
 215  0
                 append( sb, "Port.", 3 );
 216  0
                 append( sb, "", 0 );
 217  
 
 218  0
                 append( sb, "sslMode (Default: false)", 2 );
 219  0
                 append( sb, "If the email should be sent in SSL mode.", 3 );
 220  0
                 append( sb, "", 0 );
 221  
 
 222  0
                 append( sb, "subject (Default: [ANNOUNCEMENT] - ${project.name} ${project.version} released)", 2 );
 223  0
                 append( sb, "Subject for the email.", 3 );
 224  0
                 append( sb, "", 0 );
 225  
 
 226  0
                 append( sb, "template (Default: announcement.vm)", 2 );
 227  0
                 append( sb, "The Velocity template used to format the announcement.", 3 );
 228  0
                 append( sb, "", 0 );
 229  
 
 230  0
                 append( sb, "templateOutputDirectory", 2 );
 231  0
                 append( sb, "Directory which contains the template for announcement email.", 3 );
 232  0
                 append( sb, "", 0 );
 233  
 
 234  0
                 append( sb, "toAddresses", 2 );
 235  0
                 append( sb, "Recipient email address.", 3 );
 236  0
                 append( sb, "", 0 );
 237  
 
 238  0
                 append( sb, "username", 2 );
 239  0
                 append( sb, "The username used to send the email.", 3 );
 240  0
                 append( sb, "", 0 );
 241  
             }
 242  
         }
 243  
 
 244  0
         if ( goal == null || goal.length() <= 0 || "changes-report".equals( goal ) )
 245  
         {
 246  0
             append( sb, "changes:changes-report", 0 );
 247  0
             append( sb, "Goal which creates a nicely formatted Changes Report in html format from a changes.xml file.", 1 );
 248  0
             append( sb, "", 0 );
 249  0
             if ( detail )
 250  
             {
 251  0
                 append( sb, "Available parameters:", 1 );
 252  0
                 append( sb, "", 0 );
 253  
 
 254  0
                 append( sb, "addActionDate (Default: false)", 2 );
 255  0
                 append( sb, "A flag whether the report should also include the dates of individual actions. If set to false, only the dates of releases will be written to the report.", 3 );
 256  0
                 append( sb, "", 0 );
 257  
 
 258  0
                 append( sb, "filteringChanges (Default: false)", 2 );
 259  0
                 append( sb, "applying filtering filtering \'a la\' resources plugin", 3 );
 260  0
                 append( sb, "", 0 );
 261  
 
 262  0
                 append( sb, "issueLinkTemplate (Default: %URL%/ViewIssue.jspa?key=%ISSUE%)", 2 );
 263  0
                 append( sb, "Deprecated. As of 2.1 use issueLinkTemplatePerSystem : this one will be with system default", 3 );
 264  0
                 append( sb, "", 0 );
 265  0
                 append( sb, "Template string that is used to discover the URL to use to display an issue report. There are 2 template tokens you can use. %URL%: this is computed by getting the <issueManagement>/<url> value from the POM, and removing the last \'/\' and everything that comes after it. %ISSUE%: this is the issue number.\nNote: In versions of this plugin prior to 2.0-beta-2 this parameter was called link_template.\n", 3 );
 266  0
                 append( sb, "", 0 );
 267  
 
 268  0
                 append( sb, "issueLinkTemplatePerSystem", 2 );
 269  0
                 append( sb, "Template strings per system that is used to discover the URL to use to display an issue report. Each key in this map denotes the (case-sensitive) identifier of the issue tracking system and its value gives the URL template.\nThere are 2 template tokens you can use. %URL%: this is computed by getting the <issueManagement>/<url> value from the POM, and removing the last \'/\' and everything that comes after it. %ISSUE%: this is the issue number.\n\nNote: The deprecated issueLinkTemplate will be used for a system called \'default\'.\n", 3 );
 270  0
                 append( sb, "", 0 );
 271  
 
 272  0
                 append( sb, "outputDirectory (Default: ${project.reporting.outputDirectory})", 2 );
 273  0
                 append( sb, "Report output directory. Note that this parameter is only relevant if the goal is run from the command line or from the default build lifecycle. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
 274  0
                 append( sb, "", 0 );
 275  
 
 276  0
                 append( sb, "publishDateFormat (Default: yyyy-MM-dd)", 2 );
 277  0
                 append( sb, "Format to use for publishDate. The value will be available with the following expression ${publishDate}", 3 );
 278  0
                 append( sb, "", 0 );
 279  
 
 280  0
                 append( sb, "publishDateLocale (Default: en)", 2 );
 281  0
                 append( sb, "Locale to use for publishDate when formatting", 3 );
 282  0
                 append( sb, "", 0 );
 283  
 
 284  0
                 append( sb, "xmlPath (Default: src/changes/changes.xml)", 2 );
 285  0
                 append( sb, "The path of the changes.xml file that will be converted into an HTML report.", 3 );
 286  0
                 append( sb, "", 0 );
 287  
             }
 288  
         }
 289  
 
 290  0
         if ( goal == null || goal.length() <= 0 || "changes-validate".equals( goal ) )
 291  
         {
 292  0
             append( sb, "changes:changes-validate", 0 );
 293  0
             append( sb, "Goal which validate the changes.xml file.", 1 );
 294  0
             append( sb, "", 0 );
 295  0
             if ( detail )
 296  
             {
 297  0
                 append( sb, "Available parameters:", 1 );
 298  0
                 append( sb, "", 0 );
 299  
 
 300  0
                 append( sb, "changesXsdVersion (Default: 1.0.0)", 2 );
 301  0
                 append( sb, "The changes xsd version.", 3 );
 302  0
                 append( sb, "", 0 );
 303  
 
 304  0
                 append( sb, "failOnError (Default: false)", 2 );
 305  0
                 append( sb, "Mojo failure if validation failed. If not and validation failed only a warning will be logged.", 3 );
 306  0
                 append( sb, "", 0 );
 307  
 
 308  0
                 append( sb, "xmlPath (Default: src/changes/changes.xml)", 2 );
 309  0
                 append( sb, "The path of the changes.xml file that will be converted into an HTML report.", 3 );
 310  0
                 append( sb, "", 0 );
 311  
             }
 312  
         }
 313  
 
 314  0
         if ( goal == null || goal.length() <= 0 || "help".equals( goal ) )
 315  
         {
 316  0
             append( sb, "changes:help", 0 );
 317  0
             append( sb, "Display help information on maven-changes-plugin.\nCall\n\u00a0\u00a0mvn\u00a0changes:help\u00a0-Ddetail=true\u00a0-Dgoal=<goal-name>\nto display parameter details.", 1 );
 318  0
             append( sb, "", 0 );
 319  0
             if ( detail )
 320  
             {
 321  0
                 append( sb, "Available parameters:", 1 );
 322  0
                 append( sb, "", 0 );
 323  
 
 324  0
                 append( sb, "detail (Default: false)", 2 );
 325  0
                 append( sb, "If true, display all settable properties for each goal.", 3 );
 326  0
                 append( sb, "", 0 );
 327  
 
 328  0
                 append( sb, "goal", 2 );
 329  0
                 append( sb, "The name of the goal for which to show help. If unspecified, all goals will be displayed.", 3 );
 330  0
                 append( sb, "", 0 );
 331  
 
 332  0
                 append( sb, "indentSize (Default: 2)", 2 );
 333  0
                 append( sb, "The number of spaces per indentation level, should be positive.", 3 );
 334  0
                 append( sb, "", 0 );
 335  
 
 336  0
                 append( sb, "lineLength (Default: 80)", 2 );
 337  0
                 append( sb, "The maximum length of a display line, should be positive.", 3 );
 338  0
                 append( sb, "", 0 );
 339  
             }
 340  
         }
 341  
 
 342  0
         if ( goal == null || goal.length() <= 0 || "jira-report".equals( goal ) )
 343  
         {
 344  0
             append( sb, "changes:jira-report", 0 );
 345  0
             append( sb, "Goal which downloads issues from the Issue Tracking System and generates a report.", 1 );
 346  0
             append( sb, "", 0 );
 347  0
             if ( detail )
 348  
             {
 349  0
                 append( sb, "Available parameters:", 1 );
 350  0
                 append( sb, "", 0 );
 351  
 
 352  0
                 append( sb, "columnNames (Default: Key,Summary,Status,Resolution,Assignee)", 2 );
 353  0
                 append( sb, "Sets the column names that you want to show in the report. The columns will appear in the report in the same order as you specify them here. Multiple values can be separated by commas.\nValid columns are: Key, Summary, Status, Resolution, Assignee, Reporter, Type, Priority, Version, Fix Version and Component.\n", 3 );
 354  0
                 append( sb, "", 0 );
 355  
 
 356  0
                 append( sb, "component", 2 );
 357  0
                 append( sb, "Sets the component(s) that you want to limit your report to include. Multiple values can be separated by commas (such as 10011,10012). If this is set to empty - that means all components will be included.", 3 );
 358  0
                 append( sb, "", 0 );
 359  
 
 360  0
                 append( sb, "filter", 2 );
 361  0
                 append( sb, "Defines the filter parameters to restrict which issues are retrieved from JIRA. The filter parameter uses the same format of url parameters that is used in a JIRA search.", 3 );
 362  0
                 append( sb, "", 0 );
 363  
 
 364  0
                 append( sb, "fixVersionIds", 2 );
 365  0
                 append( sb, "Sets the fix version id(s) that you want to limit your report to include. These are JIRA\'s internal version ids, NOT the human readable display ones. Multiple fix versions can be separated by commas. If this is set to empty - that means all fix versions will be included.", 3 );
 366  0
                 append( sb, "", 0 );
 367  
 
 368  0
                 append( sb, "jiraPassword", 2 );
 369  0
                 append( sb, "Defines the JIRA password for authentication into a private JIRA installation.", 3 );
 370  0
                 append( sb, "", 0 );
 371  
 
 372  0
                 append( sb, "jiraUser", 2 );
 373  0
                 append( sb, "Defines the JIRA username for authentication into a private JIRA installation.", 3 );
 374  0
                 append( sb, "", 0 );
 375  
 
 376  0
                 append( sb, "maxEntries (Default: 100)", 2 );
 377  0
                 append( sb, "Maximum number of entries to be fetched from JIRA.", 3 );
 378  0
                 append( sb, "", 0 );
 379  
 
 380  0
                 append( sb, "onlyCurrentVersion (Default: false)", 2 );
 381  0
                 append( sb, "If you only want to show issues for the current version in the report. The current version being used is ${project.version} minus any \'-SNAPSHOT\' suffix.", 3 );
 382  0
                 append( sb, "", 0 );
 383  
 
 384  0
                 append( sb, "outputDirectory (Default: ${project.reporting.outputDirectory})", 2 );
 385  0
                 append( sb, "Report output directory. Note that this parameter is only relevant if the goal is run from the command line or from the default build lifecycle. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
 386  0
                 append( sb, "", 0 );
 387  
 
 388  0
                 append( sb, "priorityIds", 2 );
 389  0
                 append( sb, "Sets the priority(s) that you want to limit your report to include. Valid statuses are Blocker, Critical, Major, Minor and Trivial. Multiple values can be separated by commas. If this is set to empty - that means all priorities will be included.", 3 );
 390  0
                 append( sb, "", 0 );
 391  
 
 392  0
                 append( sb, "resolutionIds (Default: Fixed)", 2 );
 393  0
                 append( sb, "Sets the resolution(s) that you want to fetch from JIRA. Valid resolutions are: Unresolved, Fixed, Won\'t Fix, Duplicate, Incomplete and Cannot Reproduce. Multiple values can be separated by commas.\nNote: In versions 2.0-beta-3 and earlier this parameter had no default value.\n", 3 );
 394  0
                 append( sb, "", 0 );
 395  
 
 396  0
                 append( sb, "sortColumnNames (Default: Priority DESC, Created DESC)", 2 );
 397  0
                 append( sb, "Sets the column names that you want to sort the report by. Add DESC following the column name to specify descending sequence. For example Fix Version DESC, Type sorts first by the Fix Version in descending order and then by Type in ascending order. By default sorting is done in ascending order, but is possible to specify ASC for consistency. The previous example would then become Fix Version DESC, Type ASC.\nValid columns are: Key, Summary, Status, Resolution, Assignee, Reporter, Type, Priority, Version, Fix Version, Component, Created and Updated.\n", 3 );
 398  0
                 append( sb, "", 0 );
 399  
 
 400  0
                 append( sb, "statusIds (Default: Closed)", 2 );
 401  0
                 append( sb, "Sets the status(es) that you want to fetch from JIRA. Valid statuses are: Open, In Progress, Reopened, Resolved and Closed. Multiple values can be separated by commas.\nNote: In versions 2.0-beta-3 and earlier this parameter had no default value.\n", 3 );
 402  0
                 append( sb, "", 0 );
 403  
 
 404  0
                 append( sb, "typeIds", 2 );
 405  0
                 append( sb, "Sets the types(s) that you want to limit your report to include. Valid types are: Bug, New Feature, Task, Improvement, Wish, Test and Sub-task. Multiple values can be separated by commas. If this is set to empty - that means all types will be included.", 3 );
 406  0
                 append( sb, "", 0 );
 407  
 
 408  0
                 append( sb, "webPassword", 2 );
 409  0
                 append( sb, "Defines the http password for basic authentication into the JIRA webserver.", 3 );
 410  0
                 append( sb, "", 0 );
 411  
 
 412  0
                 append( sb, "webUser", 2 );
 413  0
                 append( sb, "Defines the http user for basic authentication into the JIRA webserver.", 3 );
 414  0
                 append( sb, "", 0 );
 415  
             }
 416  
         }
 417  
 
 418  0
         if ( goal == null || goal.length() <= 0 || "trac-report".equals( goal ) )
 419  
         {
 420  0
             append( sb, "changes:trac-report", 0 );
 421  0
             append( sb, "Goal which downloads issues from the Issue Tracking System and generates a report.", 1 );
 422  0
             append( sb, "", 0 );
 423  0
             if ( detail )
 424  
             {
 425  0
                 append( sb, "Available parameters:", 1 );
 426  0
                 append( sb, "", 0 );
 427  
 
 428  0
                 append( sb, "columnNames (Default: id,type,summary,owner,reporter,priority,status,resolution,created,changed)", 2 );
 429  0
                 append( sb, "Sets the column names that you want to show in the report. The columns will appear in the report in the same order as you specify them here. Multiple values can be separated by commas.\nValid columns are: id, type, summary, status, resolution, milestone, owner, priority, reporter, component, created, changed.\n", 3 );
 430  0
                 append( sb, "", 0 );
 431  
 
 432  0
                 append( sb, "outputDirectory (Default: ${project.reporting.outputDirectory})", 2 );
 433  0
                 append( sb, "Report output directory. Note that this parameter is only relevant if the goal is run from the command line or from the default build lifecycle. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
 434  0
                 append( sb, "", 0 );
 435  
 
 436  0
                 append( sb, "query (Default: order=id)", 2 );
 437  0
                 append( sb, "Defines the Trac query for searching ticket.", 3 );
 438  0
                 append( sb, "", 0 );
 439  
 
 440  0
                 append( sb, "tracPassword", 2 );
 441  0
                 append( sb, "Defines the Trac password for authentication into a private Trac installation.", 3 );
 442  0
                 append( sb, "", 0 );
 443  
 
 444  0
                 append( sb, "tracUser", 2 );
 445  0
                 append( sb, "Defines the Trac username for authentication into a private Trac installation.", 3 );
 446  0
                 append( sb, "", 0 );
 447  
             }
 448  
         }
 449  
 
 450  0
         if ( getLog().isInfoEnabled() )
 451  
         {
 452  0
             getLog().info( sb.toString() );
 453  
         }
 454  0
     }
 455  
 
 456  
     /**
 457  
      * <p>Repeat a String <code>n</code> times to form a new string.</p>
 458  
      *
 459  
      * @param str String to repeat
 460  
      * @param repeat number of times to repeat str
 461  
      * @return String with repeated String
 462  
      * @throws NegativeArraySizeException if <code>repeat < 0</code>
 463  
      * @throws NullPointerException if str is <code>null</code>
 464  
      */
 465  
     private static String repeat( String str, int repeat )
 466  
     {
 467  0
         StringBuffer buffer = new StringBuffer( repeat * str.length() );
 468  
 
 469  0
         for ( int i = 0; i < repeat; i++ )
 470  
         {
 471  0
             buffer.append( str );
 472  
         }
 473  
 
 474  0
         return buffer.toString();
 475  
     }
 476  
 
 477  
     /** 
 478  
      * Append a description to the buffer by respecting the indentSize and lineLength parameters.
 479  
      * <b>Note</b>: The last character is always a new line.
 480  
      * 
 481  
      * @param sb The buffer to append the description, not <code>null</code>.
 482  
      * @param description The description, not <code>null</code>.
 483  
      * @param indent The base indentation level of each line, must not be negative.
 484  
      */
 485  
     private void append( StringBuffer sb, String description, int indent )
 486  
     {
 487  0
         for ( Iterator it = toLines( description, indent, indentSize, lineLength ).iterator(); it.hasNext(); )
 488  
         {
 489  0
             sb.append( it.next().toString() ).append( '\n' );
 490  
         }
 491  0
     }
 492  
 
 493  
     /** 
 494  
      * Splits the specified text into lines of convenient display length.
 495  
      * 
 496  
      * @param text The text to split into lines, must not be <code>null</code>.
 497  
      * @param indent The base indentation level of each line, must not be negative.
 498  
      * @param indentSize The size of each indentation, must not be negative.
 499  
      * @param lineLength The length of the line, must not be negative.
 500  
      * @return The sequence of display lines, never <code>null</code>.
 501  
      * @throws NegativeArraySizeException if <code>indent < 0</code>
 502  
      */
 503  
     private static List toLines( String text, int indent, int indentSize, int lineLength )
 504  
     {
 505  0
         List lines = new ArrayList();
 506  
 
 507  0
         String ind = repeat( "\t", indent );
 508  0
         String[] plainLines = text.split( "(\r\n)|(\r)|(\n)" );
 509  0
         for ( int i = 0; i < plainLines.length; i++ )
 510  
         {
 511  0
             toLines( lines, ind + plainLines[i], indentSize, lineLength );
 512  
         }
 513  
 
 514  0
         return lines;
 515  
     }
 516  
 
 517  
     /** 
 518  
      * Adds the specified line to the output sequence, performing line wrapping if necessary.
 519  
      * 
 520  
      * @param lines The sequence of display lines, must not be <code>null</code>.
 521  
      * @param line The line to add, must not be <code>null</code>.
 522  
      * @param indentSize The size of each indentation, must not be negative.
 523  
      * @param lineLength The length of the line, must not be negative.
 524  
      */
 525  
     private static void toLines( List lines, String line, int indentSize, int lineLength )
 526  
     {
 527  0
         int lineIndent = getIndentLevel( line );
 528  0
         StringBuffer buf = new StringBuffer( 256 );
 529  0
         String[] tokens = line.split( " +" );
 530  0
         for ( int i = 0; i < tokens.length; i++ )
 531  
         {
 532  0
             String token = tokens[i];
 533  0
             if ( i > 0 )
 534  
             {
 535  0
                 if ( buf.length() + token.length() >= lineLength )
 536  
                 {
 537  0
                     lines.add( buf.toString() );
 538  0
                     buf.setLength( 0 );
 539  0
                     buf.append( repeat( " ", lineIndent * indentSize ) );
 540  
                 }
 541  
                 else
 542  
                 {
 543  0
                     buf.append( ' ' );
 544  
                 }
 545  
             }
 546  0
             for ( int j = 0; j < token.length(); j++ )
 547  
             {
 548  0
                 char c = token.charAt( j );
 549  0
                 if ( c == '\t' )
 550  
                 {
 551  0
                     buf.append( repeat( " ", indentSize - buf.length() % indentSize ) );
 552  
                 }
 553  0
                 else if ( c == '\u00A0' )
 554  
                 {
 555  0
                     buf.append( ' ' );
 556  
                 }
 557  
                 else
 558  
                 {
 559  0
                     buf.append( c );
 560  
                 }
 561  
             }
 562  
         }
 563  0
         lines.add( buf.toString() );
 564  0
     }
 565  
 
 566  
     /** 
 567  
      * Gets the indentation level of the specified line.
 568  
      * 
 569  
      * @param line The line whose indentation level should be retrieved, must not be <code>null</code>.
 570  
      * @return The indentation level of the line.
 571  
      */
 572  
     private static int getIndentLevel( String line )
 573  
     {
 574  0
         int level = 0;
 575  0
         for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ )
 576  
         {
 577  0
             level++;
 578  
         }
 579  0
         for ( int i = level + 1; i <= level + 4 && i < line.length(); i++ )
 580  
         {
 581  0
             if ( line.charAt( i ) == '\t' )
 582  
             {
 583  0
                 level++;
 584  0
                 break;
 585  
             }
 586  
         }
 587  0
         return level;
 588  
     }
 589  
 }