Coverage Report - org.apache.maven.plugins.release.HelpMojo
 
Classes in this File Line Coverage Branch Coverage Complexity
HelpMojo
0%
0/427
0%
0/90
5.667
 
 1  
 package org.apache.maven.plugins.release;
 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-release-plugin. Call <pre>  mvn release:help -Ddetail=true -Dgoal=&lt;goal-name&gt;</pre> to display parameter details.
 12  
  *
 13  
  * @version generated on Mon Oct 27 19:18:03 CET 2008
 14  
  * @goal help
 15  
  * @requiresProject false
 16  
  */
 17  0
 public class HelpMojo
 18  
     extends AbstractMojo
 19  
 {
 20  
     /**
 21  
      * If <code>true</code>, display all settable properties for each goal.
 22  
      * 
 23  
      * @parameter expression="${detail}" default-value="false"
 24  
      */
 25  
     private boolean detail;
 26  
 
 27  
     /**
 28  
      * The name of the goal for which to show help. If unspecified, all goals will be displayed.
 29  
      * 
 30  
      * @parameter expression="${goal}"
 31  
      */
 32  
     private java.lang.String goal;
 33  
 
 34  
     /**
 35  
      * The maximum length of a display line.
 36  
      * 
 37  
      * @parameter expression="${lineLength}" default-value="80"
 38  
      */
 39  
     private int lineLength;
 40  
 
 41  
     /**
 42  
      * The number of spaces per indentation level.
 43  
      * 
 44  
      * @parameter expression="${indentSize}" default-value="2"
 45  
      */
 46  
     private int indentSize;
 47  
 
 48  
 
 49  
     /** {@inheritDoc} */
 50  
     public void execute()
 51  
         throws MojoExecutionException
 52  
     {
 53  0
         StringBuffer sb = new StringBuffer();
 54  
 
 55  0
         append( sb, "org.apache.maven.plugins:maven-release-plugin:2.0-beta-8", 0 );
 56  0
         append( sb, "", 0 );
 57  
 
 58  0
         append( sb, "Maven Release Plugin 2.0-beta-8", 0 );
 59  0
         append( sb, "This plugin is used to release a project with Maven, saving a lot of repetitive, manual work.", 1 );
 60  0
         append( sb, "", 0 );
 61  
 
 62  0
         if ( goal == null || goal.length() <= 0 )
 63  
         {
 64  0
             append( sb, "This plugin has 7 goals:", 0 );
 65  0
             append( sb, "", 0 );
 66  
         }
 67  
 
 68  0
         if ( goal == null || goal.length() <= 0 || "branch".equals( goal ) )
 69  
         {
 70  0
             append( sb, "release:branch", 0 );
 71  0
             append( sb, "Branch a project in SCM.", 1 );
 72  0
             append( sb, "", 0 );
 73  0
             if ( detail )
 74  
             {
 75  0
                 append( sb, "Available parameters:", 1 );
 76  0
                 append( sb, "", 0 );
 77  
 
 78  0
                 append( sb, "addSchema (Default: true)", 2 );
 79  0
                 append( sb, "Whether to add a schema to the POM if it was previously missing on release.", 3 );
 80  0
                 append( sb, "", 0 );
 81  
 
 82  0
                 append( sb, "arguments", 2 );
 83  0
                 append( sb, "Additional arguments to pass to the Maven executions, separated by spaces.", 3 );
 84  0
                 append( sb, "", 0 );
 85  
 
 86  0
                 append( sb, "autoVersionSubmodules (Default: false)", 2 );
 87  0
                 append( sb, "Whether to automatically assign submodules the parent version. If set to false, the user will be prompted for the version of each submodules.", 3 );
 88  0
                 append( sb, "", 0 );
 89  
 
 90  0
                 append( sb, "branchName", 2 );
 91  0
                 append( sb, "The branch name to use.", 3 );
 92  0
                 append( sb, "", 0 );
 93  
 
 94  0
                 append( sb, "dryRun (Default: false)", 2 );
 95  0
                 append( sb, "Dry run: don\'t checkin or tag anything in the scm repository, or modify the checkout. Running mvn -DdryRun=true release:prepare is useful in order to check that modifications to poms and scm operations (only listed on the console) are working as expected. Modified POMs are written alongside the originals without modifying them.", 3 );
 96  0
                 append( sb, "", 0 );
 97  
 
 98  0
                 append( sb, "javaHome (Default: ${java.home})", 2 );
 99  0
                 append( sb, "The JAVA_HOME parameter to use for forked Maven invocations.", 3 );
 100  0
                 append( sb, "", 0 );
 101  
 
 102  0
                 append( sb, "localRepoDirectory (Default: ${maven.repo.local})", 2 );
 103  0
                 append( sb, "The command-line local repository directory in use for this build (if specified).", 3 );
 104  0
                 append( sb, "", 0 );
 105  
 
 106  0
                 append( sb, "mavenExecutorId (Default: invoker)", 2 );
 107  0
                 append( sb, "Role hint of the MavenExecutor implementation to use.", 3 );
 108  0
                 append( sb, "", 0 );
 109  
 
 110  0
                 append( sb, "mavenHome (Default: ${maven.home})", 2 );
 111  0
                 append( sb, "The M2_HOME parameter to use for forked Maven invocations.", 3 );
 112  0
                 append( sb, "", 0 );
 113  
 
 114  0
                 append( sb, "password", 2 );
 115  0
                 append( sb, "The SCM password to use.", 3 );
 116  0
                 append( sb, "", 0 );
 117  
 
 118  0
                 append( sb, "pomFileName", 2 );
 119  0
                 append( sb, "The file name of the POM to execute any goals against.", 3 );
 120  0
                 append( sb, "", 0 );
 121  
 
 122  0
                 append( sb, "providerImplementations", 2 );
 123  0
                 append( sb, "List of provider implementations.", 3 );
 124  0
                 append( sb, "", 0 );
 125  
 
 126  0
                 append( sb, "scmCommentPrefix (Default: [maven-release-plugin] )", 2 );
 127  0
                 append( sb, "The message prefix to use for all SCM changes.", 3 );
 128  0
                 append( sb, "", 0 );
 129  
 
 130  0
                 append( sb, "tag", 2 );
 131  0
                 append( sb, "The SCM tag to use.", 3 );
 132  0
                 append( sb, "", 0 );
 133  
 
 134  0
                 append( sb, "tagBase", 2 );
 135  0
                 append( sb, "The tag base directory in SVN, you must define it if you don\'t use the standard svn layout (trunk/tags/branches). For example, http://svn.apache.org/repos/asf/maven/plugins/tags. The URL is an SVN URL and does not include the SCM provider and protocol.", 3 );
 136  0
                 append( sb, "", 0 );
 137  
 
 138  0
                 append( sb, "updateBranchVersions (Default: false)", 2 );
 139  0
                 append( sb, "Whether to update versions in the branch.", 3 );
 140  0
                 append( sb, "", 0 );
 141  
 
 142  0
                 append( sb, "updateDependencies (Default: true)", 2 );
 143  0
                 append( sb, "Whether to update dependencies version to the next development version.", 3 );
 144  0
                 append( sb, "", 0 );
 145  
 
 146  0
                 append( sb, "updateVersionsToSnapshot (Default: true)", 2 );
 147  0
                 append( sb, "Whether to update versions to SNAPSHOT in the branch.", 3 );
 148  0
                 append( sb, "", 0 );
 149  
 
 150  0
                 append( sb, "updateWorkingCopyVersions (Default: true)", 2 );
 151  0
                 append( sb, "Whether to update versions in the working copy.", 3 );
 152  0
                 append( sb, "", 0 );
 153  
 
 154  0
                 append( sb, "useEditMode (Default: false)", 2 );
 155  0
                 append( sb, "Whether to use \'edit\' mode on the SCM, to lock the file for editing during SCM operations.", 3 );
 156  0
                 append( sb, "", 0 );
 157  
 
 158  0
                 append( sb, "username", 2 );
 159  0
                 append( sb, "The SCM username to use.", 3 );
 160  0
                 append( sb, "", 0 );
 161  
             }
 162  
         }
 163  
 
 164  0
         if ( goal == null || goal.length() <= 0 || "clean".equals( goal ) )
 165  
         {
 166  0
             append( sb, "release:clean", 0 );
 167  0
             append( sb, "Clean up after a release preparation.", 1 );
 168  0
             append( sb, "", 0 );
 169  0
             if ( detail )
 170  
             {
 171  0
                 append( sb, "Available parameters:", 1 );
 172  0
                 append( sb, "", 0 );
 173  
 
 174  0
                 append( sb, "arguments", 2 );
 175  0
                 append( sb, "Additional arguments to pass to the Maven executions, separated by spaces.", 3 );
 176  0
                 append( sb, "", 0 );
 177  
 
 178  0
                 append( sb, "javaHome (Default: ${java.home})", 2 );
 179  0
                 append( sb, "The JAVA_HOME parameter to use for forked Maven invocations.", 3 );
 180  0
                 append( sb, "", 0 );
 181  
 
 182  0
                 append( sb, "localRepoDirectory (Default: ${maven.repo.local})", 2 );
 183  0
                 append( sb, "The command-line local repository directory in use for this build (if specified).", 3 );
 184  0
                 append( sb, "", 0 );
 185  
 
 186  0
                 append( sb, "mavenExecutorId (Default: invoker)", 2 );
 187  0
                 append( sb, "Role hint of the MavenExecutor implementation to use.", 3 );
 188  0
                 append( sb, "", 0 );
 189  
 
 190  0
                 append( sb, "mavenHome (Default: ${maven.home})", 2 );
 191  0
                 append( sb, "The M2_HOME parameter to use for forked Maven invocations.", 3 );
 192  0
                 append( sb, "", 0 );
 193  
 
 194  0
                 append( sb, "password", 2 );
 195  0
                 append( sb, "The SCM password to use.", 3 );
 196  0
                 append( sb, "", 0 );
 197  
 
 198  0
                 append( sb, "pomFileName", 2 );
 199  0
                 append( sb, "The file name of the POM to execute any goals against.", 3 );
 200  0
                 append( sb, "", 0 );
 201  
 
 202  0
                 append( sb, "providerImplementations", 2 );
 203  0
                 append( sb, "List of provider implementations.", 3 );
 204  0
                 append( sb, "", 0 );
 205  
 
 206  0
                 append( sb, "scmCommentPrefix (Default: [maven-release-plugin] )", 2 );
 207  0
                 append( sb, "The message prefix to use for all SCM changes.", 3 );
 208  0
                 append( sb, "", 0 );
 209  
 
 210  0
                 append( sb, "tag", 2 );
 211  0
                 append( sb, "The SCM tag to use.", 3 );
 212  0
                 append( sb, "", 0 );
 213  
 
 214  0
                 append( sb, "tagBase", 2 );
 215  0
                 append( sb, "The tag base directory in SVN, you must define it if you don\'t use the standard svn layout (trunk/tags/branches). For example, http://svn.apache.org/repos/asf/maven/plugins/tags. The URL is an SVN URL and does not include the SCM provider and protocol.", 3 );
 216  0
                 append( sb, "", 0 );
 217  
 
 218  0
                 append( sb, "username", 2 );
 219  0
                 append( sb, "The SCM username to use.", 3 );
 220  0
                 append( sb, "", 0 );
 221  
             }
 222  
         }
 223  
 
 224  0
         if ( goal == null || goal.length() <= 0 || "help".equals( goal ) )
 225  
         {
 226  0
             append( sb, "release:help", 0 );
 227  0
             append( sb, "Display help information on maven-release-plugin. Call\n\u00a0\u00a0mvn\u00a0release:help\u00a0-Ddetail=true\u00a0-Dgoal=<goal-name>\nto display parameter details.", 1 );
 228  0
             append( sb, "", 0 );
 229  0
             if ( detail )
 230  
             {
 231  0
                 append( sb, "Available parameters:", 1 );
 232  0
                 append( sb, "", 0 );
 233  
 
 234  0
                 append( sb, "detail (Default: false)", 2 );
 235  0
                 append( sb, "If true, display all settable properties for each goal.", 3 );
 236  0
                 append( sb, "", 0 );
 237  
 
 238  0
                 append( sb, "goal", 2 );
 239  0
                 append( sb, "The name of the goal for which to show help. If unspecified, all goals will be displayed.", 3 );
 240  0
                 append( sb, "", 0 );
 241  
 
 242  0
                 append( sb, "lineLength (Default: 80)", 2 );
 243  0
                 append( sb, "The maximum length of a display line.", 3 );
 244  0
                 append( sb, "", 0 );
 245  
 
 246  0
                 append( sb, "indentSize (Default: 2)", 2 );
 247  0
                 append( sb, "The number of spaces per indentation level.", 3 );
 248  0
                 append( sb, "", 0 );
 249  
             }
 250  
         }
 251  
 
 252  0
         if ( goal == null || goal.length() <= 0 || "perform".equals( goal ) )
 253  
         {
 254  0
             append( sb, "release:perform", 0 );
 255  0
             append( sb, "Perform a release from SCM.", 1 );
 256  0
             append( sb, "", 0 );
 257  0
             if ( detail )
 258  
             {
 259  0
                 append( sb, "Available parameters:", 1 );
 260  0
                 append( sb, "", 0 );
 261  
 
 262  0
                 append( sb, "arguments", 2 );
 263  0
                 append( sb, "Additional arguments to pass to the Maven executions, separated by spaces.", 3 );
 264  0
                 append( sb, "", 0 );
 265  
 
 266  0
                 append( sb, "connectionUrl", 2 );
 267  0
                 append( sb, "The SCM URL to checkout from. If omitted, the one from the release.properties file is used, followed by the URL from the current POM.", 3 );
 268  0
                 append( sb, "", 0 );
 269  
 
 270  0
                 append( sb, "goals", 2 );
 271  0
                 append( sb, "A comma or space separated list of goals to execute on deployment. Default value is either deploy or deploy site-deploy, if the project has a <distributionManagement>/<site> element.", 3 );
 272  0
                 append( sb, "", 0 );
 273  
 
 274  0
                 append( sb, "javaHome (Default: ${java.home})", 2 );
 275  0
                 append( sb, "The JAVA_HOME parameter to use for forked Maven invocations.", 3 );
 276  0
                 append( sb, "", 0 );
 277  
 
 278  0
                 append( sb, "localRepoDirectory (Default: ${maven.repo.local})", 2 );
 279  0
                 append( sb, "The command-line local repository directory in use for this build (if specified).", 3 );
 280  0
                 append( sb, "", 0 );
 281  
 
 282  0
                 append( sb, "mavenExecutorId (Default: invoker)", 2 );
 283  0
                 append( sb, "Role hint of the MavenExecutor implementation to use.", 3 );
 284  0
                 append( sb, "", 0 );
 285  
 
 286  0
                 append( sb, "mavenHome (Default: ${maven.home})", 2 );
 287  0
                 append( sb, "The M2_HOME parameter to use for forked Maven invocations.", 3 );
 288  0
                 append( sb, "", 0 );
 289  
 
 290  0
                 append( sb, "password", 2 );
 291  0
                 append( sb, "The SCM password to use.", 3 );
 292  0
                 append( sb, "", 0 );
 293  
 
 294  0
                 append( sb, "pomFileName", 2 );
 295  0
                 append( sb, "The file name of the POM to execute any goals against.", 3 );
 296  0
                 append( sb, "", 0 );
 297  
 
 298  0
                 append( sb, "providerImplementations", 2 );
 299  0
                 append( sb, "List of provider implementations.", 3 );
 300  0
                 append( sb, "", 0 );
 301  
 
 302  0
                 append( sb, "releaseProfiles", 2 );
 303  0
                 append( sb, "Comma separated profiles to enable on deployment, in addition to active profiles for project execution.", 3 );
 304  0
                 append( sb, "", 0 );
 305  
 
 306  0
                 append( sb, "scmCommentPrefix (Default: [maven-release-plugin] )", 2 );
 307  0
                 append( sb, "The message prefix to use for all SCM changes.", 3 );
 308  0
                 append( sb, "", 0 );
 309  
 
 310  0
                 append( sb, "tag", 2 );
 311  0
                 append( sb, "The SCM tag to use.", 3 );
 312  0
                 append( sb, "", 0 );
 313  
 
 314  0
                 append( sb, "tagBase", 2 );
 315  0
                 append( sb, "The tag base directory in SVN, you must define it if you don\'t use the standard svn layout (trunk/tags/branches). For example, http://svn.apache.org/repos/asf/maven/plugins/tags. The URL is an SVN URL and does not include the SCM provider and protocol.", 3 );
 316  0
                 append( sb, "", 0 );
 317  
 
 318  0
                 append( sb, "useReleaseProfile (Default: true)", 2 );
 319  0
                 append( sb, "Whether to use the release profile that adds sources and javadocs to the released artifact, if appropriate.", 3 );
 320  0
                 append( sb, "", 0 );
 321  
 
 322  0
                 append( sb, "username", 2 );
 323  0
                 append( sb, "The SCM username to use.", 3 );
 324  0
                 append( sb, "", 0 );
 325  
 
 326  0
                 append( sb, "workingDirectory (Default: ${project.build.directory}/checkout)", 2 );
 327  0
                 append( sb, "The checkout directory.", 3 );
 328  0
                 append( sb, "", 0 );
 329  
             }
 330  
         }
 331  
 
 332  0
         if ( goal == null || goal.length() <= 0 || "prepare".equals( goal ) )
 333  
         {
 334  0
             append( sb, "release:prepare", 0 );
 335  0
             append( sb, "Prepare for a release in SCM.", 1 );
 336  0
             append( sb, "", 0 );
 337  0
             if ( detail )
 338  
             {
 339  0
                 append( sb, "Available parameters:", 1 );
 340  0
                 append( sb, "", 0 );
 341  
 
 342  0
                 append( sb, "addSchema (Default: true)", 2 );
 343  0
                 append( sb, "Whether to add a schema to the POM if it was previously missing on release.", 3 );
 344  0
                 append( sb, "", 0 );
 345  
 
 346  0
                 append( sb, "allowTimestampedSnapshots (Default: false)", 2 );
 347  0
                 append( sb, "Whether to allow timestamped SNAPSHOT dependencies. Default is to fail when finding any SNAPSHOT.", 3 );
 348  0
                 append( sb, "", 0 );
 349  
 
 350  0
                 append( sb, "arguments", 2 );
 351  0
                 append( sb, "Additional arguments to pass to the Maven executions, separated by spaces.", 3 );
 352  0
                 append( sb, "", 0 );
 353  
 
 354  0
                 append( sb, "autoVersionSubmodules (Default: false)", 2 );
 355  0
                 append( sb, "Whether to automatically assign submodules the parent version. If set to false, the user will be prompted for the version of each submodules.", 3 );
 356  0
                 append( sb, "", 0 );
 357  
 
 358  0
                 append( sb, "commitByProject (Default: false)", 2 );
 359  0
                 append( sb, "Commits to do are atomic or by project.", 3 );
 360  0
                 append( sb, "", 0 );
 361  
 
 362  0
                 append( sb, "developmentVersion", 2 );
 363  0
                 append( sb, "Default version to use for new local working copy.", 3 );
 364  0
                 append( sb, "", 0 );
 365  
 
 366  0
                 append( sb, "dryRun (Default: false)", 2 );
 367  0
                 append( sb, "Dry run: don\'t checkin or tag anything in the scm repository, or modify the checkout. Running mvn -DdryRun=true release:prepare is useful in order to check that modifications to poms and scm operations (only listed on the console) are working as expected. Modified POMs are written alongside the originals without modifying them.", 3 );
 368  0
                 append( sb, "", 0 );
 369  
 
 370  0
                 append( sb, "generateReleasePoms (Default: false)", 2 );
 371  0
                 append( sb, "Whether to generate release-pom.xml files that contain resolved information about the project.", 3 );
 372  0
                 append( sb, "", 0 );
 373  
 
 374  0
                 append( sb, "javaHome (Default: ${java.home})", 2 );
 375  0
                 append( sb, "The JAVA_HOME parameter to use for forked Maven invocations.", 3 );
 376  0
                 append( sb, "", 0 );
 377  
 
 378  0
                 append( sb, "localRepoDirectory (Default: ${maven.repo.local})", 2 );
 379  0
                 append( sb, "The command-line local repository directory in use for this build (if specified).", 3 );
 380  0
                 append( sb, "", 0 );
 381  
 
 382  0
                 append( sb, "mavenExecutorId (Default: invoker)", 2 );
 383  0
                 append( sb, "Role hint of the MavenExecutor implementation to use.", 3 );
 384  0
                 append( sb, "", 0 );
 385  
 
 386  0
                 append( sb, "mavenHome (Default: ${maven.home})", 2 );
 387  0
                 append( sb, "The M2_HOME parameter to use for forked Maven invocations.", 3 );
 388  0
                 append( sb, "", 0 );
 389  
 
 390  0
                 append( sb, "password", 2 );
 391  0
                 append( sb, "The SCM password to use.", 3 );
 392  0
                 append( sb, "", 0 );
 393  
 
 394  0
                 append( sb, "pomFileName", 2 );
 395  0
                 append( sb, "The file name of the POM to execute any goals against.", 3 );
 396  0
                 append( sb, "", 0 );
 397  
 
 398  0
                 append( sb, "preparationGoals (Default: clean verify)", 2 );
 399  0
                 append( sb, "Goals to run as part of the preparation step, after transformation but before committing. Space delimited.", 3 );
 400  0
                 append( sb, "", 0 );
 401  
 
 402  0
                 append( sb, "providerImplementations", 2 );
 403  0
                 append( sb, "List of provider implementations.", 3 );
 404  0
                 append( sb, "", 0 );
 405  
 
 406  0
                 append( sb, "releaseVersion", 2 );
 407  0
                 append( sb, "Default version to use when preparing a release or a branch.", 3 );
 408  0
                 append( sb, "", 0 );
 409  
 
 410  0
                 append( sb, "resume (Default: true)", 2 );
 411  0
                 append( sb, "Resume a previous release attempt from the point where it was stopped.", 3 );
 412  0
                 append( sb, "", 0 );
 413  
 
 414  0
                 append( sb, "scmCommentPrefix (Default: [maven-release-plugin] )", 2 );
 415  0
                 append( sb, "The message prefix to use for all SCM changes.", 3 );
 416  0
                 append( sb, "", 0 );
 417  
 
 418  0
                 append( sb, "tag", 2 );
 419  0
                 append( sb, "The SCM tag to use.", 3 );
 420  0
                 append( sb, "", 0 );
 421  
 
 422  0
                 append( sb, "tagBase", 2 );
 423  0
                 append( sb, "The tag base directory in SVN, you must define it if you don\'t use the standard svn layout (trunk/tags/branches). For example, http://svn.apache.org/repos/asf/maven/plugins/tags. The URL is an SVN URL and does not include the SCM provider and protocol.", 3 );
 424  0
                 append( sb, "", 0 );
 425  
 
 426  0
                 append( sb, "updateDependencies (Default: true)", 2 );
 427  0
                 append( sb, "Whether to update dependencies version to the next development version.", 3 );
 428  0
                 append( sb, "", 0 );
 429  
 
 430  0
                 append( sb, "useEditMode (Default: false)", 2 );
 431  0
                 append( sb, "Whether to use \'edit\' mode on the SCM, to lock the file for editing during SCM operations.", 3 );
 432  0
                 append( sb, "", 0 );
 433  
 
 434  0
                 append( sb, "username", 2 );
 435  0
                 append( sb, "The SCM username to use.", 3 );
 436  0
                 append( sb, "", 0 );
 437  
             }
 438  
         }
 439  
 
 440  0
         if ( goal == null || goal.length() <= 0 || "rollback".equals( goal ) )
 441  
         {
 442  0
             append( sb, "release:rollback", 0 );
 443  0
             append( sb, "Rollback changes made by a previous release.", 1 );
 444  0
             append( sb, "", 0 );
 445  0
             if ( detail )
 446  
             {
 447  0
                 append( sb, "Available parameters:", 1 );
 448  0
                 append( sb, "", 0 );
 449  
 
 450  0
                 append( sb, "arguments", 2 );
 451  0
                 append( sb, "Additional arguments to pass to the Maven executions, separated by spaces.", 3 );
 452  0
                 append( sb, "", 0 );
 453  
 
 454  0
                 append( sb, "javaHome (Default: ${java.home})", 2 );
 455  0
                 append( sb, "The JAVA_HOME parameter to use for forked Maven invocations.", 3 );
 456  0
                 append( sb, "", 0 );
 457  
 
 458  0
                 append( sb, "localRepoDirectory (Default: ${maven.repo.local})", 2 );
 459  0
                 append( sb, "The command-line local repository directory in use for this build (if specified).", 3 );
 460  0
                 append( sb, "", 0 );
 461  
 
 462  0
                 append( sb, "mavenExecutorId (Default: invoker)", 2 );
 463  0
                 append( sb, "Role hint of the MavenExecutor implementation to use.", 3 );
 464  0
                 append( sb, "", 0 );
 465  
 
 466  0
                 append( sb, "mavenHome (Default: ${maven.home})", 2 );
 467  0
                 append( sb, "The M2_HOME parameter to use for forked Maven invocations.", 3 );
 468  0
                 append( sb, "", 0 );
 469  
 
 470  0
                 append( sb, "password", 2 );
 471  0
                 append( sb, "The SCM password to use.", 3 );
 472  0
                 append( sb, "", 0 );
 473  
 
 474  0
                 append( sb, "pomFileName", 2 );
 475  0
                 append( sb, "The file name of the POM to execute any goals against.", 3 );
 476  0
                 append( sb, "", 0 );
 477  
 
 478  0
                 append( sb, "providerImplementations", 2 );
 479  0
                 append( sb, "List of provider implementations.", 3 );
 480  0
                 append( sb, "", 0 );
 481  
 
 482  0
                 append( sb, "scmCommentPrefix (Default: [maven-release-plugin] )", 2 );
 483  0
                 append( sb, "The message prefix to use for all SCM changes.", 3 );
 484  0
                 append( sb, "", 0 );
 485  
 
 486  0
                 append( sb, "tag", 2 );
 487  0
                 append( sb, "The SCM tag to use.", 3 );
 488  0
                 append( sb, "", 0 );
 489  
 
 490  0
                 append( sb, "tagBase", 2 );
 491  0
                 append( sb, "The tag base directory in SVN, you must define it if you don\'t use the standard svn layout (trunk/tags/branches). For example, http://svn.apache.org/repos/asf/maven/plugins/tags. The URL is an SVN URL and does not include the SCM provider and protocol.", 3 );
 492  0
                 append( sb, "", 0 );
 493  
 
 494  0
                 append( sb, "username", 2 );
 495  0
                 append( sb, "The SCM username to use.", 3 );
 496  0
                 append( sb, "", 0 );
 497  
             }
 498  
         }
 499  
 
 500  0
         if ( goal == null || goal.length() <= 0 || "stage".equals( goal ) )
 501  
         {
 502  0
             append( sb, "release:stage", 0 );
 503  0
             append( sb, "Perform a release from SCM to a staging repository.", 1 );
 504  0
             append( sb, "", 0 );
 505  0
             if ( detail )
 506  
             {
 507  0
                 append( sb, "Available parameters:", 1 );
 508  0
                 append( sb, "", 0 );
 509  
 
 510  0
                 append( sb, "arguments", 2 );
 511  0
                 append( sb, "Additional arguments to pass to the Maven executions, separated by spaces.", 3 );
 512  0
                 append( sb, "", 0 );
 513  
 
 514  0
                 append( sb, "connectionUrl", 2 );
 515  0
                 append( sb, "The SCM URL to checkout from. If omitted, the one from the release.properties file is used, followed by the URL from the current POM.", 3 );
 516  0
                 append( sb, "", 0 );
 517  
 
 518  0
                 append( sb, "goals", 2 );
 519  0
                 append( sb, "A comma or space separated list of goals to execute on deployment. Default value is either deploy or deploy site-deploy, if the project has a <distributionManagement>/<site> element.", 3 );
 520  0
                 append( sb, "", 0 );
 521  
 
 522  0
                 append( sb, "javaHome (Default: ${java.home})", 2 );
 523  0
                 append( sb, "The JAVA_HOME parameter to use for forked Maven invocations.", 3 );
 524  0
                 append( sb, "", 0 );
 525  
 
 526  0
                 append( sb, "localRepoDirectory (Default: ${maven.repo.local})", 2 );
 527  0
                 append( sb, "The command-line local repository directory in use for this build (if specified).", 3 );
 528  0
                 append( sb, "", 0 );
 529  
 
 530  0
                 append( sb, "mavenExecutorId (Default: invoker)", 2 );
 531  0
                 append( sb, "Role hint of the MavenExecutor implementation to use.", 3 );
 532  0
                 append( sb, "", 0 );
 533  
 
 534  0
                 append( sb, "mavenHome (Default: ${maven.home})", 2 );
 535  0
                 append( sb, "The M2_HOME parameter to use for forked Maven invocations.", 3 );
 536  0
                 append( sb, "", 0 );
 537  
 
 538  0
                 append( sb, "password", 2 );
 539  0
                 append( sb, "The SCM password to use.", 3 );
 540  0
                 append( sb, "", 0 );
 541  
 
 542  0
                 append( sb, "pomFileName", 2 );
 543  0
                 append( sb, "The file name of the POM to execute any goals against.", 3 );
 544  0
                 append( sb, "", 0 );
 545  
 
 546  0
                 append( sb, "providerImplementations", 2 );
 547  0
                 append( sb, "List of provider implementations.", 3 );
 548  0
                 append( sb, "", 0 );
 549  
 
 550  0
                 append( sb, "releaseProfiles", 2 );
 551  0
                 append( sb, "Comma separated profiles to enable on deployment, in addition to active profiles for project execution.", 3 );
 552  0
                 append( sb, "", 0 );
 553  
 
 554  0
                 append( sb, "scmCommentPrefix (Default: [maven-release-plugin] )", 2 );
 555  0
                 append( sb, "The message prefix to use for all SCM changes.", 3 );
 556  0
                 append( sb, "", 0 );
 557  
 
 558  0
                 append( sb, "stagingRepository", 2 );
 559  0
                 append( sb, "URL of the staging repository to use.", 3 );
 560  0
                 append( sb, "", 0 );
 561  
 
 562  0
                 append( sb, "tag", 2 );
 563  0
                 append( sb, "The SCM tag to use.", 3 );
 564  0
                 append( sb, "", 0 );
 565  
 
 566  0
                 append( sb, "tagBase", 2 );
 567  0
                 append( sb, "The tag base directory in SVN, you must define it if you don\'t use the standard svn layout (trunk/tags/branches). For example, http://svn.apache.org/repos/asf/maven/plugins/tags. The URL is an SVN URL and does not include the SCM provider and protocol.", 3 );
 568  0
                 append( sb, "", 0 );
 569  
 
 570  0
                 append( sb, "useReleaseProfile (Default: true)", 2 );
 571  0
                 append( sb, "Whether to use the release profile that adds sources and javadocs to the released artifact, if appropriate.", 3 );
 572  0
                 append( sb, "", 0 );
 573  
 
 574  0
                 append( sb, "username", 2 );
 575  0
                 append( sb, "The SCM username to use.", 3 );
 576  0
                 append( sb, "", 0 );
 577  
 
 578  0
                 append( sb, "workingDirectory (Default: ${project.build.directory}/checkout)", 2 );
 579  0
                 append( sb, "The checkout directory.", 3 );
 580  0
                 append( sb, "", 0 );
 581  
             }
 582  
         }
 583  
 
 584  0
         if ( getLog().isInfoEnabled() )
 585  
         {
 586  0
             getLog().info( sb.toString() );
 587  
         }
 588  0
     }
 589  
 
 590  
     /**
 591  
      * <p>Repeat a String <code>n</code> times to form a new string.</p>
 592  
      *
 593  
      * @param str String to repeat
 594  
      * @param repeat number of times to repeat str
 595  
      * @return String with repeated String
 596  
      * @throws NegativeArraySizeException if <code>repeat < 0</code>
 597  
      * @throws NullPointerException if str is <code>null</code>
 598  
      */
 599  
     private static String repeat( String str, int repeat )
 600  
     {
 601  0
         StringBuffer buffer = new StringBuffer( repeat * str.length() );
 602  
 
 603  0
         for ( int i = 0; i < repeat; i++ )
 604  
         {
 605  0
             buffer.append( str );
 606  
         }
 607  
 
 608  0
         return buffer.toString();
 609  
     }
 610  
 
 611  
     private void append( StringBuffer sb, String description, int indent )
 612  
     {
 613  0
         for ( Iterator it = toLines( description, indent ).iterator(); it.hasNext(); )
 614  
         {
 615  0
             sb.append( it.next().toString() ).append( '\n' );
 616  
         }
 617  0
     }
 618  
 
 619  
     /** 
 620  
      * Splits the specified text into lines of convenient display length.
 621  
      * 
 622  
      * @param text The text to split into lines, must not be <code>null</code>.
 623  
      * @param indent The base indentation level of each line, must not be negative.
 624  
      * @return The sequence of display lines, never <code>null</code>.
 625  
      */
 626  
     private List toLines( String text, int indent )
 627  
     {
 628  0
         List lines = new ArrayList();
 629  
 
 630  0
         String ind = repeat( "\t", indent );
 631  0
         String[] plainLines = text.split( "(\r\n)|(\r)|(\n)" );
 632  0
         for ( int i = 0; i < plainLines.length; i++ )
 633  
         {
 634  0
             toLines( lines, ind + plainLines[i] );
 635  
         }
 636  
 
 637  0
         return lines;
 638  
     }
 639  
 
 640  
     /** 
 641  
      * Adds the specified line to the output sequence, performing line wrapping if necessary.
 642  
      * 
 643  
      * @param lines The sequence of display lines, must not be <code>null</code>.
 644  
      * @param line The line to add, must not be <code>null</code>.
 645  
      */
 646  
     private void toLines( List lines, String line )
 647  
     {
 648  0
         int lineIndent = getIndentLevel( line );
 649  0
         StringBuffer buf = new StringBuffer( 256 );
 650  0
         String[] tokens = line.split( " +" );
 651  0
         for ( int i = 0; i < tokens.length; i++ )
 652  
         {
 653  0
             String token = tokens[i];
 654  0
             if ( i > 0 )
 655  
             {
 656  0
                 if ( buf.length() + token.length() >= lineLength )
 657  
                 {
 658  0
                     lines.add( buf.toString() );
 659  0
                     buf.setLength( 0 );
 660  0
                     buf.append( repeat( " ", lineIndent * indentSize ) );
 661  
                 }
 662  
                 else
 663  
                 {
 664  0
                     buf.append( ' ' );
 665  
                 }
 666  
             }
 667  0
             for ( int j = 0; j < token.length(); j++ )
 668  
             {
 669  0
                 char c = token.charAt( j );
 670  0
                 if ( c == '\t' )
 671  
                 {
 672  0
                     buf.append( repeat( " ", indentSize - buf.length() % indentSize ) );
 673  
                 }
 674  0
                 else if ( c == '\u00A0' )
 675  
                 {
 676  0
                     buf.append( ' ' );
 677  
                 }
 678  
                 else
 679  
                 {
 680  0
                     buf.append( c );
 681  
                 }
 682  
             }
 683  
         }
 684  0
         lines.add( buf.toString() );
 685  0
     }
 686  
 
 687  
     /** 
 688  
      * Gets the indentation level of the specified line.
 689  
      * 
 690  
      * @param line The line whose indentation level should be retrieved, must not be <code>null</code>.
 691  
      * @return The indentation level of the line.
 692  
      */
 693  
     private static int getIndentLevel( String line )
 694  
     {
 695  0
         int level = 0;
 696  0
         for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ )
 697  
         {
 698  0
             level++;
 699  
         }
 700  0
         for ( int i = level + 1; i <= level + 4 && i < line.length(); i++ )
 701  
         {
 702  0
             if ( line.charAt( i ) == '\t' )
 703  
             {
 704  0
                 level++;
 705  0
                 break;
 706  
             }
 707  
         }
 708  0
         return level;
 709  
     }
 710  
 }