Coverage Report - org.apache.maven.plugin.announcement.HelpMojo
 
Classes in this File Line Coverage Branch Coverage Complexity
HelpMojo
0%
0/294
0%
0/314
27,75
 
 1  
 package org.apache.maven.plugin.announcement;
 2  
 
 3  
 import java.util.ArrayList;
 4  
 import java.util.Iterator;
 5  
 import java.util.List;
 6  
 import java.util.StringTokenizer;
 7  
 
 8  
 import org.apache.maven.plugin.AbstractMojo;
 9  
 import org.apache.maven.plugin.MojoExecutionException;
 10  
 
 11  
 /**
 12  
  * Display help information on 'org.apache.maven.plugins:maven-changes-plugin' plugin. Call 'mvn changes:help -Ddetail=true' to display all details.
 13  
  *
 14  
  * @version generated on Wed Apr 16 20:04:15 CEST 2008
 15  
  * @goal help
 16  
  */
 17  0
 public class HelpMojo
 18  
     extends AbstractMojo
 19  
 {
 20  
     /** 80-character display buffer */
 21  
     private static final int DEFAULT_WIDTH = 80;
 22  
 
 23  
     /** 4 indent spaces */
 24  0
     private static final String DEFAULT_INDENT = repeat( " ", 2 );
 25  
 
 26  
     /**
 27  
      * If true, display all settable properies for each goal.
 28  
      *
 29  
      * @parameter expression="${detail}" default-value="false"
 30  
      */
 31  
     private boolean detail;
 32  
 
 33  
     /** {@inheritDoc} */
 34  
     public void execute()
 35  
         throws MojoExecutionException
 36  
     {
 37  0
         StringBuffer sb = new StringBuffer();
 38  
 
 39  0
         sb.append( "The 'org.apache.maven.plugins:maven-changes-plugin' plugin has 6 goals:" ).append( "\n" );
 40  0
         sb.append( "\n" );
 41  
 
 42  0
         sb.append( "changes:announcement-generate" ).append( "\n" );
 43  0
         for ( Iterator it = toLines( "Goal which generate the template for an announcement." ).iterator(); it.hasNext(); )
 44  
         {
 45  0
             sb.append( it.next().toString() ).append( "\n" );
 46  
         }
 47  0
         if ( detail )
 48  
         {
 49  0
             sb.append( "\n" );
 50  
 
 51  0
             sb.append( repeat( " ", 2 ) );
 52  0
             sb.append( "Available parameters:" ).append( "\n" );
 53  
 
 54  0
             sb.append( "\n" );
 55  
 
 56  0
         for ( Iterator it = toLines( "developmentTeam (Default: '${project.name} team')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 57  
         {
 58  0
             sb.append( it.next().toString() ).append( "\n" );
 59  
         }
 60  0
             for ( Iterator it = toLines( "Name of the team that develops the artifact.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 61  
             {
 62  0
                 sb.append( it.next().toString() ).append( "\n" );
 63  
             }
 64  0
         for ( Iterator it = toLines( "finalName", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 65  
         {
 66  0
             sb.append( it.next().toString() ).append( "\n" );
 67  
         }
 68  0
             for ( Iterator it = toLines( "The name of the artifact to be used in the announcement.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 69  
             {
 70  0
                 sb.append( it.next().toString() ).append( "\n" );
 71  
             }
 72  0
         for ( Iterator it = toLines( "generateJiraAnnouncement (Default: 'false')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 73  
         {
 74  0
             sb.append( it.next().toString() ).append( "\n" );
 75  
         }
 76  0
             for ( Iterator it = toLines( "Flag to determine if the plugin will generate a JIRA announcement.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 77  
             {
 78  0
                 sb.append( it.next().toString() ).append( "\n" );
 79  
             }
 80  0
         for ( Iterator it = toLines( "introduction", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 81  
         {
 82  0
             sb.append( it.next().toString() ).append( "\n" );
 83  
         }
 84  0
             for ( Iterator it = toLines( "Short description or introduction of the released artifact.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 85  
             {
 86  0
                 sb.append( it.next().toString() ).append( "\n" );
 87  
             }
 88  0
         for ( Iterator it = toLines( "maxEntries (Default: '25')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 89  
         {
 90  0
             sb.append( it.next().toString() ).append( "\n" );
 91  
         }
 92  0
             for ( Iterator it = toLines( "The maximum number of issues to include.Note: In versions 2.0-beta-3 and earlier this parameter was called 'nbEntries'.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 93  
             {
 94  0
                 sb.append( it.next().toString() ).append( "\n" );
 95  
             }
 96  0
         for ( Iterator it = toLines( "outputDirectory", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 97  
         {
 98  0
             sb.append( it.next().toString() ).append( "\n" );
 99  
         }
 100  0
             for ( Iterator it = toLines( "Directory where the template file will be generated.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 101  
             {
 102  0
                 sb.append( it.next().toString() ).append( "\n" );
 103  
             }
 104  0
         for ( Iterator it = toLines( "resolutionIds (Default: 'Fixed')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 105  
         {
 106  0
             sb.append( it.next().toString() ).append( "\n" );
 107  
         }
 108  0
             for ( Iterator it = toLines( "Only fixed issues are needed.Note: In versions 2.0-beta-3 and earlier this parameter was called 'resolutionId'.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 109  
             {
 110  0
                 sb.append( it.next().toString() ).append( "\n" );
 111  
             }
 112  0
         for ( Iterator it = toLines( "statusIds (Default: 'Closed')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 113  
         {
 114  0
             sb.append( it.next().toString() ).append( "\n" );
 115  
         }
 116  0
             for ( Iterator it = toLines( "Only closed issues are needed.Note: In versions 2.0-beta-3 and earlier this parameter was called 'statusId'.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 117  
             {
 118  0
                 sb.append( it.next().toString() ).append( "\n" );
 119  
             }
 120  0
         for ( Iterator it = toLines( "template (Default: 'announcement.vm')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 121  
         {
 122  0
             sb.append( it.next().toString() ).append( "\n" );
 123  
         }
 124  0
             for ( Iterator it = toLines( "The Velocity template used to format the announcement.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 125  
             {
 126  0
                 sb.append( it.next().toString() ).append( "\n" );
 127  
             }
 128  0
         for ( Iterator it = toLines( "templateDirectory (Default: 'org/apache/maven/plugin/announcement')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 129  
         {
 130  0
             sb.append( it.next().toString() ).append( "\n" );
 131  
         }
 132  0
             for ( Iterator it = toLines( "Directory that contains the template.Note: This directory must be a subdirectory of /src/main/resources/.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 133  
             {
 134  0
                 sb.append( it.next().toString() ).append( "\n" );
 135  
             }
 136  0
         for ( Iterator it = toLines( "url", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 137  
         {
 138  0
             sb.append( it.next().toString() ).append( "\n" );
 139  
         }
 140  0
             for ( Iterator it = toLines( "Distribution url of the artifact.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 141  
             {
 142  0
                 sb.append( it.next().toString() ).append( "\n" );
 143  
             }
 144  0
         for ( Iterator it = toLines( "urlDownload", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 145  
         {
 146  0
             sb.append( it.next().toString() ).append( "\n" );
 147  
         }
 148  0
             for ( Iterator it = toLines( "URL where the artifact can be downloaded. If not specified, no URL is used.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 149  
             {
 150  0
                 sb.append( it.next().toString() ).append( "\n" );
 151  
             }
 152  0
         for ( Iterator it = toLines( "xmlPath", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 153  
         {
 154  0
             sb.append( it.next().toString() ).append( "\n" );
 155  
         }
 156  0
             for ( Iterator it = toLines( "The path of the changes.xml file.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 157  
             {
 158  0
                 sb.append( it.next().toString() ).append( "\n" );
 159  
             }
 160  0
         }
 161  
 
 162  0
         sb.append( "\n" );
 163  
 
 164  0
         sb.append( "changes:jira-report" ).append( "\n" );
 165  0
         for ( Iterator it = toLines( "Goal which downloads issues from the Issue Tracking System and generates a report." ).iterator(); it.hasNext(); )
 166  0
         {
 167  0
             sb.append( it.next().toString() ).append( "\n" );
 168  0
         }
 169  0
         if ( detail )
 170  0
         {
 171  0
             sb.append( "\n" );
 172  0
 
 173  0
             sb.append( repeat( " ", 2 ) );
 174  0
             sb.append( "Available parameters:" ).append( "\n" );
 175  
 
 176  0
             sb.append( "\n" );
 177  
 
 178  0
         for ( Iterator it = toLines( "columnNames (Default: 'Key,Summary,Status,Resolution,Assignee')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 179  
         {
 180  0
             sb.append( it.next().toString() ).append( "\n" );
 181  
         }
 182  0
             for ( Iterator it = toLines( "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.Valid columns are: Key, Summary, Status, Resolution, Assignee, Reporter, Type, Priority, Version, Fix Version and Component.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 183  
             {
 184  0
                 sb.append( it.next().toString() ).append( "\n" );
 185  
             }
 186  0
         for ( Iterator it = toLines( "component", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 187  
         {
 188  0
             sb.append( it.next().toString() ).append( "\n" );
 189  0
         }
 190  0
             for ( Iterator it = toLines( "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.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 191  0
             {
 192  0
                 sb.append( it.next().toString() ).append( "\n" );
 193  0
             }
 194  0
         for ( Iterator it = toLines( "filter", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 195  0
         {
 196  0
             sb.append( it.next().toString() ).append( "\n" );
 197  0
         }
 198  0
             for ( Iterator it = toLines( "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.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 199  
             {
 200  0
                 sb.append( it.next().toString() ).append( "\n" );
 201  
             }
 202  0
         for ( Iterator it = toLines( "fixVersionIds", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 203  
         {
 204  0
             sb.append( it.next().toString() ).append( "\n" );
 205  
         }
 206  0
             for ( Iterator it = toLines( "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.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 207  
             {
 208  0
                 sb.append( it.next().toString() ).append( "\n" );
 209  
             }
 210  0
         for ( Iterator it = toLines( "jiraPassword", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 211  
         {
 212  0
             sb.append( it.next().toString() ).append( "\n" );
 213  
         }
 214  0
             for ( Iterator it = toLines( "Defines the JIRA password for authentication into a private JIRA installation.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 215  
             {
 216  0
                 sb.append( it.next().toString() ).append( "\n" );
 217  
             }
 218  0
         for ( Iterator it = toLines( "jiraUser", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 219  
         {
 220  0
             sb.append( it.next().toString() ).append( "\n" );
 221  
         }
 222  0
             for ( Iterator it = toLines( "Defines the JIRA username for authentication into a private JIRA installation.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 223  
             {
 224  0
                 sb.append( it.next().toString() ).append( "\n" );
 225  
             }
 226  0
         for ( Iterator it = toLines( "maxEntries (Default: '100')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 227  
         {
 228  0
             sb.append( it.next().toString() ).append( "\n" );
 229  
         }
 230  0
             for ( Iterator it = toLines( "Maximum number of entries to be fetched from JIRA.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 231  0
             {
 232  0
                 sb.append( it.next().toString() ).append( "\n" );
 233  0
             }
 234  0
         for ( Iterator it = toLines( "onlyCurrentVersion (Default: 'false')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 235  0
         {
 236  0
             sb.append( it.next().toString() ).append( "\n" );
 237  0
         }
 238  0
             for ( Iterator it = toLines( "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.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 239  0
             {
 240  0
                 sb.append( it.next().toString() ).append( "\n" );
 241  
             }
 242  0
         for ( Iterator it = toLines( "outputDirectory", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 243  
         {
 244  0
             sb.append( it.next().toString() ).append( "\n" );
 245  
         }
 246  0
             for ( Iterator it = toLines( "Report output directory.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 247  
             {
 248  0
                 sb.append( it.next().toString() ).append( "\n" );
 249  
             }
 250  0
         for ( Iterator it = toLines( "priorityIds", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 251  
         {
 252  0
             sb.append( it.next().toString() ).append( "\n" );
 253  
         }
 254  0
             for ( Iterator it = toLines( "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.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 255  
             {
 256  0
                 sb.append( it.next().toString() ).append( "\n" );
 257  
             }
 258  0
         for ( Iterator it = toLines( "resolutionIds (Default: 'Fixed')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 259  
         {
 260  0
             sb.append( it.next().toString() ).append( "\n" );
 261  
         }
 262  0
             for ( Iterator it = toLines( "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.Note: In versions 2.0-beta-3 and earlier this parameter had no default value.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 263  
             {
 264  0
                 sb.append( it.next().toString() ).append( "\n" );
 265  
             }
 266  0
         for ( Iterator it = toLines( "sortColumnNames (Default: 'Priority DESC, Created DESC')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 267  
         {
 268  0
             sb.append( it.next().toString() ).append( "\n" );
 269  
         }
 270  0
             for ( Iterator it = toLines( "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.Valid columns are: Key, Summary, Status, Resolution, Assignee, Reporter, Type, Priority, Version, Fix Version, Component, Created and Updated.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 271  
             {
 272  0
                 sb.append( it.next().toString() ).append( "\n" );
 273  
             }
 274  0
         for ( Iterator it = toLines( "statusIds (Default: 'Closed')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 275  
         {
 276  0
             sb.append( it.next().toString() ).append( "\n" );
 277  
         }
 278  0
             for ( Iterator it = toLines( "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.Note: In versions 2.0-beta-3 and earlier this parameter had no default value.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 279  
             {
 280  0
                 sb.append( it.next().toString() ).append( "\n" );
 281  
             }
 282  0
         for ( Iterator it = toLines( "typeIds", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 283  
         {
 284  0
             sb.append( it.next().toString() ).append( "\n" );
 285  
         }
 286  0
             for ( Iterator it = toLines( "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.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 287  
             {
 288  0
                 sb.append( it.next().toString() ).append( "\n" );
 289  
             }
 290  0
         for ( Iterator it = toLines( "webPassword", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 291  
         {
 292  0
             sb.append( it.next().toString() ).append( "\n" );
 293  
         }
 294  0
             for ( Iterator it = toLines( "Defines the http password for basic authentication into the JIRA webserver.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 295  
             {
 296  0
                 sb.append( it.next().toString() ).append( "\n" );
 297  
             }
 298  0
         for ( Iterator it = toLines( "webUser", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 299  
         {
 300  0
             sb.append( it.next().toString() ).append( "\n" );
 301  
         }
 302  0
             for ( Iterator it = toLines( "Defines the http user for basic authentication into the JIRA webserver.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 303  
             {
 304  0
                 sb.append( it.next().toString() ).append( "\n" );
 305  
             }
 306  0
         }
 307  
 
 308  0
         sb.append( "\n" );
 309  
 
 310  0
         sb.append( "changes:announcement-mail" ).append( "\n" );
 311  0
         for ( Iterator it = toLines( "Goal which sends an announcement through email." ).iterator(); it.hasNext(); )
 312  0
         {
 313  0
             sb.append( it.next().toString() ).append( "\n" );
 314  0
         }
 315  0
         if ( detail )
 316  0
         {
 317  0
             sb.append( "\n" );
 318  0
 
 319  0
             sb.append( repeat( " ", 2 ) );
 320  0
             sb.append( "Available parameters:" ).append( "\n" );
 321  
 
 322  0
             sb.append( "\n" );
 323  
 
 324  0
         for ( Iterator it = toLines( "fromDeveloperId", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 325  
         {
 326  0
             sb.append( it.next().toString() ).append( "\n" );
 327  
         }
 328  0
             for ( Iterator it = toLines( "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.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 329  
             {
 330  0
                 sb.append( it.next().toString() ).append( "\n" );
 331  
             }
 332  0
         for ( Iterator it = toLines( "mailSender", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 333  
         {
 334  0
             sb.append( it.next().toString() ).append( "\n" );
 335  
         }
 336  0
             for ( Iterator it = toLines( "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.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 337  0
             {
 338  0
                 sb.append( it.next().toString() ).append( "\n" );
 339  0
             }
 340  0
         for ( Iterator it = toLines( "password", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 341  0
         {
 342  0
             sb.append( it.next().toString() ).append( "\n" );
 343  0
         }
 344  0
             for ( Iterator it = toLines( "The password used to send the email.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 345  0
             {
 346  0
                 sb.append( it.next().toString() ).append( "\n" );
 347  
             }
 348  0
         for ( Iterator it = toLines( "smtpHost", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 349  
         {
 350  0
             sb.append( it.next().toString() ).append( "\n" );
 351  
         }
 352  0
             for ( Iterator it = toLines( "Smtp Server.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 353  
             {
 354  0
                 sb.append( it.next().toString() ).append( "\n" );
 355  
             }
 356  0
         for ( Iterator it = toLines( "smtpPort (Default: '25')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 357  
         {
 358  0
             sb.append( it.next().toString() ).append( "\n" );
 359  
         }
 360  0
             for ( Iterator it = toLines( "Port.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 361  
             {
 362  0
                 sb.append( it.next().toString() ).append( "\n" );
 363  0
             }
 364  0
         for ( Iterator it = toLines( "sslMode (Default: 'false')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 365  0
         {
 366  0
             sb.append( it.next().toString() ).append( "\n" );
 367  0
         }
 368  0
             for ( Iterator it = toLines( "If the email should be sent in SSL mode.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 369  0
             {
 370  0
                 sb.append( it.next().toString() ).append( "\n" );
 371  0
             }
 372  0
         for ( Iterator it = toLines( "subject (Default: '[ANNOUNCEMENT] - ${project.name} ${project.version} released')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 373  
         {
 374  0
             sb.append( it.next().toString() ).append( "\n" );
 375  
         }
 376  0
             for ( Iterator it = toLines( "Subject for the email.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 377  
             {
 378  0
                 sb.append( it.next().toString() ).append( "\n" );
 379  
             }
 380  0
         for ( Iterator it = toLines( "template (Default: 'announcement.vm')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 381  
         {
 382  0
             sb.append( it.next().toString() ).append( "\n" );
 383  
         }
 384  0
             for ( Iterator it = toLines( "The Velocity template used to format the announcement.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 385  
             {
 386  0
                 sb.append( it.next().toString() ).append( "\n" );
 387  
             }
 388  0
         for ( Iterator it = toLines( "templateOutputDirectory", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 389  
         {
 390  0
             sb.append( it.next().toString() ).append( "\n" );
 391  
         }
 392  0
             for ( Iterator it = toLines( "Directory which contains the template for announcement email.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 393  
             {
 394  0
                 sb.append( it.next().toString() ).append( "\n" );
 395  
             }
 396  0
         for ( Iterator it = toLines( "toAddresses", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 397  
         {
 398  0
             sb.append( it.next().toString() ).append( "\n" );
 399  
         }
 400  0
             for ( Iterator it = toLines( "Recipient email address.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 401  
             {
 402  0
                 sb.append( it.next().toString() ).append( "\n" );
 403  
             }
 404  0
         for ( Iterator it = toLines( "username", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 405  
         {
 406  0
             sb.append( it.next().toString() ).append( "\n" );
 407  
         }
 408  0
             for ( Iterator it = toLines( "The username used to send the email.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 409  
             {
 410  0
                 sb.append( it.next().toString() ).append( "\n" );
 411  
             }
 412  0
         }
 413  
 
 414  0
         sb.append( "\n" );
 415  
 
 416  0
         sb.append( "changes:changes-report" ).append( "\n" );
 417  0
         for ( Iterator it = toLines( "Goal which creates a nicely formatted Changes Report in html format from a changes.xml file." ).iterator(); it.hasNext(); )
 418  0
         {
 419  0
             sb.append( it.next().toString() ).append( "\n" );
 420  0
         }
 421  0
         if ( detail )
 422  0
         {
 423  0
             sb.append( "\n" );
 424  0
 
 425  0
             sb.append( repeat( " ", 2 ) );
 426  0
             sb.append( "Available parameters:" ).append( "\n" );
 427  
 
 428  0
             sb.append( "\n" );
 429  
 
 430  0
         for ( Iterator it = toLines( "issueLinkTemplate", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 431  
         {
 432  0
             sb.append( it.next().toString() ).append( "\n" );
 433  
         }
 434  0
             for ( Iterator it = toLines( "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.Note: In versions of this plugin prior to 2.0-beta-2 this parameter was called link_template.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 435  
             {
 436  0
                 sb.append( it.next().toString() ).append( "\n" );
 437  
             }
 438  0
         for ( Iterator it = toLines( "outputDirectory", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 439  
         {
 440  0
             sb.append( it.next().toString() ).append( "\n" );
 441  
         }
 442  0
             for ( Iterator it = toLines( "Report output directory.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 443  
             {
 444  0
                 sb.append( it.next().toString() ).append( "\n" );
 445  
             }
 446  0
         for ( Iterator it = toLines( "xmlPath", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 447  
         {
 448  0
             sb.append( it.next().toString() ).append( "\n" );
 449  
         }
 450  0
             for ( Iterator it = toLines( "The path of the changes.xml file that will be converted into an html report.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 451  
             {
 452  0
                 sb.append( it.next().toString() ).append( "\n" );
 453  
             }
 454  0
         }
 455  
 
 456  0
         sb.append( "\n" );
 457  
 
 458  0
         sb.append( "changes:help" ).append( "\n" );
 459  0
         for ( Iterator it = toLines( "Display help information on 'org.apache.maven.plugins:maven-changes-plugin' plugin. Call 'mvn changes:help -Ddetail=true' to display all details." ).iterator(); it.hasNext(); )
 460  0
         {
 461  0
             sb.append( it.next().toString() ).append( "\n" );
 462  0
         }
 463  0
         if ( detail )
 464  0
         {
 465  0
             sb.append( "\n" );
 466  0
 
 467  0
             sb.append( repeat( " ", 2 ) );
 468  0
             sb.append( "Available parameters:" ).append( "\n" );
 469  
 
 470  0
             sb.append( "\n" );
 471  
 
 472  0
         for ( Iterator it = toLines( "detail (Default: 'false')", repeat( " ", 4 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 473  
         {
 474  0
             sb.append( it.next().toString() ).append( "\n" );
 475  
         }
 476  0
             for ( Iterator it = toLines( "If true, display all settable properies for each goal.", repeat( " ", 6 ), DEFAULT_WIDTH ).iterator(); it.hasNext(); )
 477  
             {
 478  0
                 sb.append( it.next().toString() ).append( "\n" );
 479  
             }
 480  
         }
 481  
 
 482  0
         sb.append( "\n" );
 483  
 
 484  0
         sb.append( "changes:help" ).append( "\n" );
 485  0
         for ( Iterator it = toLines( "Display help information on 'org.apache.maven.plugins:maven-changes-plugin' plugin. Call 'mvn changes:help -Ddetail=true' to display all details." ).iterator(); it.hasNext(); )
 486  
         {
 487  0
             sb.append( it.next().toString() ).append( "\n" );
 488  
         }
 489  
 
 490  0
         if ( getLog().isInfoEnabled() )
 491  
         {
 492  0
             getLog().info( sb.toString() );
 493  
         }
 494  0
     }
 495  
 
 496  
     /**
 497  
      * <p>Repeat a String <code>n</code> times to form a new string.</p>
 498  
      *
 499  
      * @param str String to repeat
 500  
      * @param repeat number of times to repeat str
 501  
      * @return String with repeated String
 502  
      * @throws NegativeArraySizeException if <code>repeat < 0</code>
 503  
      * @throws NullPointerException if str is <code>null</code>
 504  
      */
 505  
     private static String repeat( String str, int repeat )
 506  
     {
 507  0
         StringBuffer buffer = new StringBuffer( repeat * str.length() );
 508  
 
 509  0
         for ( int i = 0; i < repeat; i++ )
 510  
         {
 511  0
             buffer.append( str );
 512  
         }
 513  
 
 514  0
         return buffer.toString();
 515  
     }
 516  
 
 517  
     /**
 518  
      * <p>Give a list of lines for the <code>str</code>. Each line is indented by 4 spaces
 519  
      * and has a maximum of <code>80</code> characters.</p>
 520  
      *
 521  
      * @param str String to split in lines
 522  
      * @return List of lines
 523  
      * @throws NullPointerException if str is <code>null</code>
 524  
      */
 525  
     private static List toLines( String str )
 526  
     {
 527  0
         return toLines( str, DEFAULT_INDENT, DEFAULT_WIDTH );
 528  
     }
 529  
 
 530  
     /**
 531  
      * <p>Give a list of lines for the <code>str</code>. Each line is indented by <code>indent</code>
 532  
      * and has a maximum of <code>size</code> characters.</p>
 533  
      *
 534  
      * @param str String to split in lines
 535  
      * @param indent the string to precede each line
 536  
      * @param size the size of the character display buffer
 537  
      * @return List of lines
 538  
      * @throws IllegalArgumentException if <code>size < 0</code>
 539  
      * @throws NullPointerException if str is <code>null</code>
 540  
      */
 541  
     private static List toLines( String str, String indent, int size )
 542  
     {
 543  0
         List sentences = new ArrayList();
 544  
 
 545  0
         if ( indent == null )
 546  
         {
 547  0
             indent = "";
 548  
         }
 549  
 
 550  0
         if ( size < 0 )
 551  
         {
 552  0
             throw new IllegalArgumentException( "size should be positive" );
 553  
         }
 554  
 
 555  0
         StringBuffer tmp = new StringBuffer( indent );
 556  0
         StringTokenizer tokenizer = new StringTokenizer( str, " " );
 557  0
         while ( tokenizer.hasMoreTokens() )
 558  
         {
 559  0
             String word = tokenizer.nextToken();
 560  
 
 561  0
             if ( tmp.length() + word.length() + 1 < size )
 562  
             {
 563  0
                 tmp.append( word ).append( " " );
 564  
             }
 565  
             else
 566  
             {
 567  0
                 sentences.add( tmp.toString() );
 568  0
                 tmp = new StringBuffer( indent );
 569  0
                 tmp.append( word ).append( " " );
 570  
             }
 571  
         }
 572  
 
 573  0
         if ( tmp.toString().length() > 0 )
 574  
         {
 575  0
             sentences.add( tmp.toString() );
 576  
         }
 577  
 
 578  0
         return sentences;
 579  
     }
 580  
 }