Coverage Report - org.apache.maven.plugin.war.HelpMojo
 
Classes in this File Line Coverage Branch Coverage Complexity
HelpMojo
0%
0/454
0%
0/78
7.5
 
 1  
 package org.apache.maven.plugin.war;
 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-war-plugin.<br/> Call <pre>  mvn war:help -Ddetail=true -Dgoal=&lt;goal-name&gt;</pre> to display parameter details.
 12  
  *
 13  
  * @version generated on Tue Jan 24 22:04:56 CET 2012
 14  
  * @author org.apache.maven.tools.plugin.generator.PluginHelpGenerator (version 2.8)
 15  
  * @goal help
 16  
  * @requiresProject false
 17  
  * @threadSafe
 18  
  */
 19  
 @SuppressWarnings( "all" )
 20  0
 public class HelpMojo
 21  
     extends AbstractMojo
 22  
 {
 23  
     /**
 24  
      * If <code>true</code>, display all settable properties for each goal.
 25  
      * 
 26  
      * @parameter expression="${detail}" default-value="false"
 27  
      */
 28  
     private boolean detail;
 29  
 
 30  
     /**
 31  
      * The name of the goal for which to show help. If unspecified, all goals will be displayed.
 32  
      * 
 33  
      * @parameter expression="${goal}"
 34  
      */
 35  
     private java.lang.String goal;
 36  
 
 37  
     /**
 38  
      * The maximum length of a display line, should be positive.
 39  
      * 
 40  
      * @parameter expression="${lineLength}" default-value="80"
 41  
      */
 42  
     private int lineLength;
 43  
 
 44  
     /**
 45  
      * The number of spaces per indentation level, should be positive.
 46  
      * 
 47  
      * @parameter expression="${indentSize}" default-value="2"
 48  
      */
 49  
     private int indentSize;
 50  
 
 51  
 
 52  
     /** {@inheritDoc} */
 53  
     public void execute()
 54  
         throws MojoExecutionException
 55  
     {
 56  0
         if ( lineLength <= 0 )
 57  
         {
 58  0
             getLog().warn( "The parameter 'lineLength' should be positive, using '80' as default." );
 59  0
             lineLength = 80;
 60  
         }
 61  0
         if ( indentSize <= 0 )
 62  
         {
 63  0
             getLog().warn( "The parameter 'indentSize' should be positive, using '2' as default." );
 64  0
             indentSize = 2;
 65  
         }
 66  
 
 67  0
         StringBuffer sb = new StringBuffer();
 68  
 
 69  0
         append( sb, "org.apache.maven.plugins:maven-war-plugin:2.2", 0 );
 70  0
         append( sb, "", 0 );
 71  
 
 72  0
         append( sb, "Maven WAR Plugin", 0 );
 73  0
         append( sb, "Builds a Web Application Archive (WAR) file from the project output and its dependencies.", 1 );
 74  0
         append( sb, "", 0 );
 75  
 
 76  0
         if ( goal == null || goal.length() <= 0 )
 77  
         {
 78  0
             append( sb, "This plugin has 5 goals:", 0 );
 79  0
             append( sb, "", 0 );
 80  
         }
 81  
 
 82  0
         if ( goal == null || goal.length() <= 0 || "exploded".equals( goal ) )
 83  
         {
 84  0
             append( sb, "war:exploded", 0 );
 85  0
             append( sb, "Create an exploded webapp in a specified directory.", 1 );
 86  0
             append( sb, "", 0 );
 87  0
             if ( detail )
 88  
             {
 89  0
                 append( sb, "Available parameters:", 1 );
 90  0
                 append( sb, "", 0 );
 91  
 
 92  0
                 append( sb, "archive", 2 );
 93  0
                 append( sb, "The archive configuration to use. See Maven Archiver Reference.", 3 );
 94  0
                 append( sb, "", 0 );
 95  
 
 96  0
                 append( sb, "archiveClasses (Default: false)", 2 );
 97  0
                 append( sb, "Whether a JAR file will be created for the classes in the webapp. Using this optional configuration parameter will make the compiled classes to be archived into a JAR file and the classes directory will then be excluded from the webapp.", 3 );
 98  0
                 append( sb, "Expression: ${archiveClasses}", 3 );
 99  0
                 append( sb, "", 0 );
 100  
 
 101  0
                 append( sb, "cacheFile (Default: ${project.build.directory}/war/work/webapp-cache.xml)", 2 );
 102  0
                 append( sb, "The file containing the webapp structure cache.", 3 );
 103  0
                 append( sb, "Required: Yes", 3 );
 104  0
                 append( sb, "", 0 );
 105  
 
 106  0
                 append( sb, "containerConfigXML", 2 );
 107  0
                 append( sb, "The path to a configuration file for the servlet container. Note that the file name may be different for different servlet containers. Apache Tomcat uses a configuration file named context.xml. The file will be copied to the META-INF directory.", 3 );
 108  0
                 append( sb, "Expression: ${maven.war.containerConfigXML}", 3 );
 109  0
                 append( sb, "", 0 );
 110  
 
 111  0
                 append( sb, "dependentWarExcludes", 2 );
 112  0
                 append( sb, "Deprecated. Use <overlay>/<excludes> instead", 3 );
 113  0
                 append( sb, "", 0 );
 114  0
                 append( sb, "The comma separated list of tokens to exclude when doing a WAR overlay.", 3 );
 115  0
                 append( sb, "", 0 );
 116  
 
 117  0
                 append( sb, "dependentWarIncludes", 2 );
 118  0
                 append( sb, "Deprecated. Use <overlay>/<includes> instead", 3 );
 119  0
                 append( sb, "", 0 );
 120  0
                 append( sb, "The comma separated list of tokens to include when doing a WAR overlay. Default is \'**\'", 3 );
 121  0
                 append( sb, "", 0 );
 122  
 
 123  0
                 append( sb, "escapedBackslashesInFilePath (Default: false)", 2 );
 124  0
                 append( sb, "To escape interpolated values with Windows path c:\\foo\\bar will be replaced with c:\\\\foo\\\\bar.", 3 );
 125  0
                 append( sb, "Expression: ${maven.war.escapedBackslashesInFilePath}", 3 );
 126  0
                 append( sb, "", 0 );
 127  
 
 128  0
                 append( sb, "escapeString", 2 );
 129  0
                 append( sb, "Expression preceded with this String won\'t be interpolated. \\${foo} will be replaced with ${foo}.", 3 );
 130  0
                 append( sb, "Expression: ${maven.war.escapeString}", 3 );
 131  0
                 append( sb, "", 0 );
 132  
 
 133  0
                 append( sb, "filteringDeploymentDescriptors (Default: false)", 2 );
 134  0
                 append( sb, "To filter deployment descriptors. Disabled by default.", 3 );
 135  0
                 append( sb, "Expression: ${maven.war.filteringDeploymentDescriptors}", 3 );
 136  0
                 append( sb, "", 0 );
 137  
 
 138  0
                 append( sb, "filters", 2 );
 139  0
                 append( sb, "Filters (property files) to include during the interpolation of the pom.xml.", 3 );
 140  0
                 append( sb, "", 0 );
 141  
 
 142  0
                 append( sb, "nonFilteredFileExtensions", 2 );
 143  0
                 append( sb, "A list of file extensions that should not be filtered. Will be used when filtering webResources and overlays.", 3 );
 144  0
                 append( sb, "", 0 );
 145  
 
 146  0
                 append( sb, "outputFileNameMapping", 2 );
 147  0
                 append( sb, "The file name mapping to use when copying libraries and TLDs. If no file mapping is set (default) the files are copied with their standard names.", 3 );
 148  0
                 append( sb, "", 0 );
 149  
 
 150  0
                 append( sb, "overlays", 2 );
 151  0
                 append( sb, "The overlays to apply.", 3 );
 152  0
                 append( sb, "", 0 );
 153  
 
 154  0
                 append( sb, "useCache (Default: false)", 2 );
 155  0
                 append( sb, "Whether the cache should be used to save the status of the webapp across multiple runs. Experimental feature so disabled by default.", 3 );
 156  0
                 append( sb, "Expression: ${useCache}", 3 );
 157  0
                 append( sb, "", 0 );
 158  
 
 159  0
                 append( sb, "warSourceDirectory (Default: ${basedir}/src/main/webapp)", 2 );
 160  0
                 append( sb, "Single directory for extra files to include in the WAR. This is where you place your JSP files.", 3 );
 161  0
                 append( sb, "Required: Yes", 3 );
 162  0
                 append( sb, "", 0 );
 163  
 
 164  0
                 append( sb, "warSourceExcludes", 2 );
 165  0
                 append( sb, "The comma separated list of tokens to exclude when copying the content of the warSourceDirectory.", 3 );
 166  0
                 append( sb, "", 0 );
 167  
 
 168  0
                 append( sb, "warSourceIncludes (Default: **)", 2 );
 169  0
                 append( sb, "The comma separated list of tokens to include when copying the content of the warSourceDirectory.", 3 );
 170  0
                 append( sb, "", 0 );
 171  
 
 172  0
                 append( sb, "webappDirectory (Default: ${project.build.directory}/${project.build.finalName})", 2 );
 173  0
                 append( sb, "The directory where the webapp is built.", 3 );
 174  0
                 append( sb, "Required: Yes", 3 );
 175  0
                 append( sb, "", 0 );
 176  
 
 177  0
                 append( sb, "webResources", 2 );
 178  0
                 append( sb, "The list of webResources we want to transfer.", 3 );
 179  0
                 append( sb, "", 0 );
 180  
 
 181  0
                 append( sb, "webXml", 2 );
 182  0
                 append( sb, "The path to the web.xml file to use.", 3 );
 183  0
                 append( sb, "Expression: ${maven.war.webxml}", 3 );
 184  0
                 append( sb, "", 0 );
 185  
 
 186  0
                 append( sb, "workDirectory (Default: ${project.build.directory}/war/work)", 2 );
 187  0
                 append( sb, "Directory to unpack dependent WARs into if needed.", 3 );
 188  0
                 append( sb, "Required: Yes", 3 );
 189  0
                 append( sb, "", 0 );
 190  
             }
 191  
         }
 192  
 
 193  0
         if ( goal == null || goal.length() <= 0 || "help".equals( goal ) )
 194  
         {
 195  0
             append( sb, "war:help", 0 );
 196  0
             append( sb, "Display help information on maven-war-plugin.\nCall\n\u00a0\u00a0mvn\u00a0war:help\u00a0-Ddetail=true\u00a0-Dgoal=<goal-name>\nto display parameter details.", 1 );
 197  0
             append( sb, "", 0 );
 198  0
             if ( detail )
 199  
             {
 200  0
                 append( sb, "Available parameters:", 1 );
 201  0
                 append( sb, "", 0 );
 202  
 
 203  0
                 append( sb, "detail (Default: false)", 2 );
 204  0
                 append( sb, "If true, display all settable properties for each goal.", 3 );
 205  0
                 append( sb, "Expression: ${detail}", 3 );
 206  0
                 append( sb, "", 0 );
 207  
 
 208  0
                 append( sb, "goal", 2 );
 209  0
                 append( sb, "The name of the goal for which to show help. If unspecified, all goals will be displayed.", 3 );
 210  0
                 append( sb, "Expression: ${goal}", 3 );
 211  0
                 append( sb, "", 0 );
 212  
 
 213  0
                 append( sb, "indentSize (Default: 2)", 2 );
 214  0
                 append( sb, "The number of spaces per indentation level, should be positive.", 3 );
 215  0
                 append( sb, "Expression: ${indentSize}", 3 );
 216  0
                 append( sb, "", 0 );
 217  
 
 218  0
                 append( sb, "lineLength (Default: 80)", 2 );
 219  0
                 append( sb, "The maximum length of a display line, should be positive.", 3 );
 220  0
                 append( sb, "Expression: ${lineLength}", 3 );
 221  0
                 append( sb, "", 0 );
 222  
             }
 223  
         }
 224  
 
 225  0
         if ( goal == null || goal.length() <= 0 || "inplace".equals( goal ) )
 226  
         {
 227  0
             append( sb, "war:inplace", 0 );
 228  0
             append( sb, "Generate the webapp in the WAR source directory.", 1 );
 229  0
             append( sb, "", 0 );
 230  0
             if ( detail )
 231  
             {
 232  0
                 append( sb, "Available parameters:", 1 );
 233  0
                 append( sb, "", 0 );
 234  
 
 235  0
                 append( sb, "archive", 2 );
 236  0
                 append( sb, "The archive configuration to use. See Maven Archiver Reference.", 3 );
 237  0
                 append( sb, "", 0 );
 238  
 
 239  0
                 append( sb, "archiveClasses (Default: false)", 2 );
 240  0
                 append( sb, "Whether a JAR file will be created for the classes in the webapp. Using this optional configuration parameter will make the compiled classes to be archived into a JAR file and the classes directory will then be excluded from the webapp.", 3 );
 241  0
                 append( sb, "Expression: ${archiveClasses}", 3 );
 242  0
                 append( sb, "", 0 );
 243  
 
 244  0
                 append( sb, "cacheFile (Default: ${project.build.directory}/war/work/webapp-cache.xml)", 2 );
 245  0
                 append( sb, "The file containing the webapp structure cache.", 3 );
 246  0
                 append( sb, "Required: Yes", 3 );
 247  0
                 append( sb, "", 0 );
 248  
 
 249  0
                 append( sb, "containerConfigXML", 2 );
 250  0
                 append( sb, "The path to a configuration file for the servlet container. Note that the file name may be different for different servlet containers. Apache Tomcat uses a configuration file named context.xml. The file will be copied to the META-INF directory.", 3 );
 251  0
                 append( sb, "Expression: ${maven.war.containerConfigXML}", 3 );
 252  0
                 append( sb, "", 0 );
 253  
 
 254  0
                 append( sb, "dependentWarExcludes", 2 );
 255  0
                 append( sb, "Deprecated. Use <overlay>/<excludes> instead", 3 );
 256  0
                 append( sb, "", 0 );
 257  0
                 append( sb, "The comma separated list of tokens to exclude when doing a WAR overlay.", 3 );
 258  0
                 append( sb, "", 0 );
 259  
 
 260  0
                 append( sb, "dependentWarIncludes", 2 );
 261  0
                 append( sb, "Deprecated. Use <overlay>/<includes> instead", 3 );
 262  0
                 append( sb, "", 0 );
 263  0
                 append( sb, "The comma separated list of tokens to include when doing a WAR overlay. Default is \'**\'", 3 );
 264  0
                 append( sb, "", 0 );
 265  
 
 266  0
                 append( sb, "escapedBackslashesInFilePath (Default: false)", 2 );
 267  0
                 append( sb, "To escape interpolated values with Windows path c:\\foo\\bar will be replaced with c:\\\\foo\\\\bar.", 3 );
 268  0
                 append( sb, "Expression: ${maven.war.escapedBackslashesInFilePath}", 3 );
 269  0
                 append( sb, "", 0 );
 270  
 
 271  0
                 append( sb, "escapeString", 2 );
 272  0
                 append( sb, "Expression preceded with this String won\'t be interpolated. \\${foo} will be replaced with ${foo}.", 3 );
 273  0
                 append( sb, "Expression: ${maven.war.escapeString}", 3 );
 274  0
                 append( sb, "", 0 );
 275  
 
 276  0
                 append( sb, "filteringDeploymentDescriptors (Default: false)", 2 );
 277  0
                 append( sb, "To filter deployment descriptors. Disabled by default.", 3 );
 278  0
                 append( sb, "Expression: ${maven.war.filteringDeploymentDescriptors}", 3 );
 279  0
                 append( sb, "", 0 );
 280  
 
 281  0
                 append( sb, "filters", 2 );
 282  0
                 append( sb, "Filters (property files) to include during the interpolation of the pom.xml.", 3 );
 283  0
                 append( sb, "", 0 );
 284  
 
 285  0
                 append( sb, "nonFilteredFileExtensions", 2 );
 286  0
                 append( sb, "A list of file extensions that should not be filtered. Will be used when filtering webResources and overlays.", 3 );
 287  0
                 append( sb, "", 0 );
 288  
 
 289  0
                 append( sb, "outputFileNameMapping", 2 );
 290  0
                 append( sb, "The file name mapping to use when copying libraries and TLDs. If no file mapping is set (default) the files are copied with their standard names.", 3 );
 291  0
                 append( sb, "", 0 );
 292  
 
 293  0
                 append( sb, "overlays", 2 );
 294  0
                 append( sb, "The overlays to apply.", 3 );
 295  0
                 append( sb, "", 0 );
 296  
 
 297  0
                 append( sb, "useCache (Default: false)", 2 );
 298  0
                 append( sb, "Whether the cache should be used to save the status of the webapp across multiple runs. Experimental feature so disabled by default.", 3 );
 299  0
                 append( sb, "Expression: ${useCache}", 3 );
 300  0
                 append( sb, "", 0 );
 301  
 
 302  0
                 append( sb, "warSourceDirectory (Default: ${basedir}/src/main/webapp)", 2 );
 303  0
                 append( sb, "Single directory for extra files to include in the WAR. This is where you place your JSP files.", 3 );
 304  0
                 append( sb, "Required: Yes", 3 );
 305  0
                 append( sb, "", 0 );
 306  
 
 307  0
                 append( sb, "warSourceExcludes", 2 );
 308  0
                 append( sb, "The comma separated list of tokens to exclude when copying the content of the warSourceDirectory.", 3 );
 309  0
                 append( sb, "", 0 );
 310  
 
 311  0
                 append( sb, "warSourceIncludes (Default: **)", 2 );
 312  0
                 append( sb, "The comma separated list of tokens to include when copying the content of the warSourceDirectory.", 3 );
 313  0
                 append( sb, "", 0 );
 314  
 
 315  0
                 append( sb, "webappDirectory (Default: ${project.build.directory}/${project.build.finalName})", 2 );
 316  0
                 append( sb, "The directory where the webapp is built.", 3 );
 317  0
                 append( sb, "Required: Yes", 3 );
 318  0
                 append( sb, "", 0 );
 319  
 
 320  0
                 append( sb, "webResources", 2 );
 321  0
                 append( sb, "The list of webResources we want to transfer.", 3 );
 322  0
                 append( sb, "", 0 );
 323  
 
 324  0
                 append( sb, "webXml", 2 );
 325  0
                 append( sb, "The path to the web.xml file to use.", 3 );
 326  0
                 append( sb, "Expression: ${maven.war.webxml}", 3 );
 327  0
                 append( sb, "", 0 );
 328  
 
 329  0
                 append( sb, "workDirectory (Default: ${project.build.directory}/war/work)", 2 );
 330  0
                 append( sb, "Directory to unpack dependent WARs into if needed.", 3 );
 331  0
                 append( sb, "Required: Yes", 3 );
 332  0
                 append( sb, "", 0 );
 333  
             }
 334  
         }
 335  
 
 336  0
         if ( goal == null || goal.length() <= 0 || "manifest".equals( goal ) )
 337  
         {
 338  0
             append( sb, "war:manifest", 0 );
 339  0
             append( sb, "Generate a manifest for this webapp. The manifest file is created in the warSourceDirectory.", 1 );
 340  0
             append( sb, "", 0 );
 341  0
             if ( detail )
 342  
             {
 343  0
                 append( sb, "Available parameters:", 1 );
 344  0
                 append( sb, "", 0 );
 345  
 
 346  0
                 append( sb, "archive", 2 );
 347  0
                 append( sb, "The archive configuration to use. See Maven Archiver Reference.", 3 );
 348  0
                 append( sb, "", 0 );
 349  
 
 350  0
                 append( sb, "archiveClasses (Default: false)", 2 );
 351  0
                 append( sb, "Whether a JAR file will be created for the classes in the webapp. Using this optional configuration parameter will make the compiled classes to be archived into a JAR file and the classes directory will then be excluded from the webapp.", 3 );
 352  0
                 append( sb, "Expression: ${archiveClasses}", 3 );
 353  0
                 append( sb, "", 0 );
 354  
 
 355  0
                 append( sb, "cacheFile (Default: ${project.build.directory}/war/work/webapp-cache.xml)", 2 );
 356  0
                 append( sb, "The file containing the webapp structure cache.", 3 );
 357  0
                 append( sb, "Required: Yes", 3 );
 358  0
                 append( sb, "", 0 );
 359  
 
 360  0
                 append( sb, "containerConfigXML", 2 );
 361  0
                 append( sb, "The path to a configuration file for the servlet container. Note that the file name may be different for different servlet containers. Apache Tomcat uses a configuration file named context.xml. The file will be copied to the META-INF directory.", 3 );
 362  0
                 append( sb, "Expression: ${maven.war.containerConfigXML}", 3 );
 363  0
                 append( sb, "", 0 );
 364  
 
 365  0
                 append( sb, "dependentWarExcludes", 2 );
 366  0
                 append( sb, "Deprecated. Use <overlay>/<excludes> instead", 3 );
 367  0
                 append( sb, "", 0 );
 368  0
                 append( sb, "The comma separated list of tokens to exclude when doing a WAR overlay.", 3 );
 369  0
                 append( sb, "", 0 );
 370  
 
 371  0
                 append( sb, "dependentWarIncludes", 2 );
 372  0
                 append( sb, "Deprecated. Use <overlay>/<includes> instead", 3 );
 373  0
                 append( sb, "", 0 );
 374  0
                 append( sb, "The comma separated list of tokens to include when doing a WAR overlay. Default is \'**\'", 3 );
 375  0
                 append( sb, "", 0 );
 376  
 
 377  0
                 append( sb, "escapedBackslashesInFilePath (Default: false)", 2 );
 378  0
                 append( sb, "To escape interpolated values with Windows path c:\\foo\\bar will be replaced with c:\\\\foo\\\\bar.", 3 );
 379  0
                 append( sb, "Expression: ${maven.war.escapedBackslashesInFilePath}", 3 );
 380  0
                 append( sb, "", 0 );
 381  
 
 382  0
                 append( sb, "escapeString", 2 );
 383  0
                 append( sb, "Expression preceded with this String won\'t be interpolated. \\${foo} will be replaced with ${foo}.", 3 );
 384  0
                 append( sb, "Expression: ${maven.war.escapeString}", 3 );
 385  0
                 append( sb, "", 0 );
 386  
 
 387  0
                 append( sb, "filteringDeploymentDescriptors (Default: false)", 2 );
 388  0
                 append( sb, "To filter deployment descriptors. Disabled by default.", 3 );
 389  0
                 append( sb, "Expression: ${maven.war.filteringDeploymentDescriptors}", 3 );
 390  0
                 append( sb, "", 0 );
 391  
 
 392  0
                 append( sb, "filters", 2 );
 393  0
                 append( sb, "Filters (property files) to include during the interpolation of the pom.xml.", 3 );
 394  0
                 append( sb, "", 0 );
 395  
 
 396  0
                 append( sb, "nonFilteredFileExtensions", 2 );
 397  0
                 append( sb, "A list of file extensions that should not be filtered. Will be used when filtering webResources and overlays.", 3 );
 398  0
                 append( sb, "", 0 );
 399  
 
 400  0
                 append( sb, "outputFileNameMapping", 2 );
 401  0
                 append( sb, "The file name mapping to use when copying libraries and TLDs. If no file mapping is set (default) the files are copied with their standard names.", 3 );
 402  0
                 append( sb, "", 0 );
 403  
 
 404  0
                 append( sb, "overlays", 2 );
 405  0
                 append( sb, "The overlays to apply.", 3 );
 406  0
                 append( sb, "", 0 );
 407  
 
 408  0
                 append( sb, "useCache (Default: false)", 2 );
 409  0
                 append( sb, "Whether the cache should be used to save the status of the webapp across multiple runs. Experimental feature so disabled by default.", 3 );
 410  0
                 append( sb, "Expression: ${useCache}", 3 );
 411  0
                 append( sb, "", 0 );
 412  
 
 413  0
                 append( sb, "warSourceDirectory (Default: ${basedir}/src/main/webapp)", 2 );
 414  0
                 append( sb, "Single directory for extra files to include in the WAR. This is where you place your JSP files.", 3 );
 415  0
                 append( sb, "Required: Yes", 3 );
 416  0
                 append( sb, "", 0 );
 417  
 
 418  0
                 append( sb, "warSourceExcludes", 2 );
 419  0
                 append( sb, "The comma separated list of tokens to exclude when copying the content of the warSourceDirectory.", 3 );
 420  0
                 append( sb, "", 0 );
 421  
 
 422  0
                 append( sb, "warSourceIncludes (Default: **)", 2 );
 423  0
                 append( sb, "The comma separated list of tokens to include when copying the content of the warSourceDirectory.", 3 );
 424  0
                 append( sb, "", 0 );
 425  
 
 426  0
                 append( sb, "webappDirectory (Default: ${project.build.directory}/${project.build.finalName})", 2 );
 427  0
                 append( sb, "The directory where the webapp is built.", 3 );
 428  0
                 append( sb, "Required: Yes", 3 );
 429  0
                 append( sb, "", 0 );
 430  
 
 431  0
                 append( sb, "webResources", 2 );
 432  0
                 append( sb, "The list of webResources we want to transfer.", 3 );
 433  0
                 append( sb, "", 0 );
 434  
 
 435  0
                 append( sb, "webXml", 2 );
 436  0
                 append( sb, "The path to the web.xml file to use.", 3 );
 437  0
                 append( sb, "Expression: ${maven.war.webxml}", 3 );
 438  0
                 append( sb, "", 0 );
 439  
 
 440  0
                 append( sb, "workDirectory (Default: ${project.build.directory}/war/work)", 2 );
 441  0
                 append( sb, "Directory to unpack dependent WARs into if needed.", 3 );
 442  0
                 append( sb, "Required: Yes", 3 );
 443  0
                 append( sb, "", 0 );
 444  
             }
 445  
         }
 446  
 
 447  0
         if ( goal == null || goal.length() <= 0 || "war".equals( goal ) )
 448  
         {
 449  0
             append( sb, "war:war", 0 );
 450  0
             append( sb, "Build a WAR file.", 1 );
 451  0
             append( sb, "", 0 );
 452  0
             if ( detail )
 453  
             {
 454  0
                 append( sb, "Available parameters:", 1 );
 455  0
                 append( sb, "", 0 );
 456  
 
 457  0
                 append( sb, "archive", 2 );
 458  0
                 append( sb, "The archive configuration to use. See Maven Archiver Reference.", 3 );
 459  0
                 append( sb, "", 0 );
 460  
 
 461  0
                 append( sb, "archiveClasses (Default: false)", 2 );
 462  0
                 append( sb, "Whether a JAR file will be created for the classes in the webapp. Using this optional configuration parameter will make the compiled classes to be archived into a JAR file and the classes directory will then be excluded from the webapp.", 3 );
 463  0
                 append( sb, "Expression: ${archiveClasses}", 3 );
 464  0
                 append( sb, "", 0 );
 465  
 
 466  0
                 append( sb, "attachClasses (Default: false)", 2 );
 467  0
                 append( sb, "Whether classes (that is the content of the WEB-INF/classes directory) should be attached to the project as an additional artifact.\nBy default the classifier for the additional artifact is \'classes\'. You can change it with the <classesClassifier>someclassifier</classesClassifier> parameter.\n\nIf this parameter true, another project can depend on the classes by writing something like:\n\n<dependency>\n\u00a0\u00a0<groupId>myGroup</groupId>\n\u00a0\u00a0<artifactId>myArtifact</artifactId>\n\u00a0\u00a0<version>myVersion</myVersion>\n\u00a0\u00a0<classifier>classes</classifier>\n</dependency>\n\n\n", 3 );
 468  0
                 append( sb, "", 0 );
 469  
 
 470  0
                 append( sb, "cacheFile (Default: ${project.build.directory}/war/work/webapp-cache.xml)", 2 );
 471  0
                 append( sb, "The file containing the webapp structure cache.", 3 );
 472  0
                 append( sb, "Required: Yes", 3 );
 473  0
                 append( sb, "", 0 );
 474  
 
 475  0
                 append( sb, "classesClassifier (Default: classes)", 2 );
 476  0
                 append( sb, "The classifier to use for the attached classes artifact.", 3 );
 477  0
                 append( sb, "", 0 );
 478  
 
 479  0
                 append( sb, "classifier", 2 );
 480  0
                 append( sb, "Classifier to add to the generated WAR. If given, the artifact will be an attachment instead. The classifier will not be applied to the JAR file of the project - only to the WAR file.", 3 );
 481  0
                 append( sb, "", 0 );
 482  
 
 483  0
                 append( sb, "containerConfigXML", 2 );
 484  0
                 append( sb, "The path to a configuration file for the servlet container. Note that the file name may be different for different servlet containers. Apache Tomcat uses a configuration file named context.xml. The file will be copied to the META-INF directory.", 3 );
 485  0
                 append( sb, "Expression: ${maven.war.containerConfigXML}", 3 );
 486  0
                 append( sb, "", 0 );
 487  
 
 488  0
                 append( sb, "dependentWarExcludes", 2 );
 489  0
                 append( sb, "Deprecated. Use <overlay>/<excludes> instead", 3 );
 490  0
                 append( sb, "", 0 );
 491  0
                 append( sb, "The comma separated list of tokens to exclude when doing a WAR overlay.", 3 );
 492  0
                 append( sb, "", 0 );
 493  
 
 494  0
                 append( sb, "dependentWarIncludes", 2 );
 495  0
                 append( sb, "Deprecated. Use <overlay>/<includes> instead", 3 );
 496  0
                 append( sb, "", 0 );
 497  0
                 append( sb, "The comma separated list of tokens to include when doing a WAR overlay. Default is \'**\'", 3 );
 498  0
                 append( sb, "", 0 );
 499  
 
 500  0
                 append( sb, "escapedBackslashesInFilePath (Default: false)", 2 );
 501  0
                 append( sb, "To escape interpolated values with Windows path c:\\foo\\bar will be replaced with c:\\\\foo\\\\bar.", 3 );
 502  0
                 append( sb, "Expression: ${maven.war.escapedBackslashesInFilePath}", 3 );
 503  0
                 append( sb, "", 0 );
 504  
 
 505  0
                 append( sb, "escapeString", 2 );
 506  0
                 append( sb, "Expression preceded with this String won\'t be interpolated. \\${foo} will be replaced with ${foo}.", 3 );
 507  0
                 append( sb, "Expression: ${maven.war.escapeString}", 3 );
 508  0
                 append( sb, "", 0 );
 509  
 
 510  0
                 append( sb, "failOnMissingWebXml (Default: true)", 2 );
 511  0
                 append( sb, "Whether or not to fail the build if the web.xml file is missing. Set to false if you want you WAR built without a web.xml file. This may be useful if you are building an overlay that has no web.xml file.", 3 );
 512  0
                 append( sb, "Expression: ${failOnMissingWebXml}", 3 );
 513  0
                 append( sb, "", 0 );
 514  
 
 515  0
                 append( sb, "filteringDeploymentDescriptors (Default: false)", 2 );
 516  0
                 append( sb, "To filter deployment descriptors. Disabled by default.", 3 );
 517  0
                 append( sb, "Expression: ${maven.war.filteringDeploymentDescriptors}", 3 );
 518  0
                 append( sb, "", 0 );
 519  
 
 520  0
                 append( sb, "filters", 2 );
 521  0
                 append( sb, "Filters (property files) to include during the interpolation of the pom.xml.", 3 );
 522  0
                 append( sb, "", 0 );
 523  
 
 524  0
                 append( sb, "nonFilteredFileExtensions", 2 );
 525  0
                 append( sb, "A list of file extensions that should not be filtered. Will be used when filtering webResources and overlays.", 3 );
 526  0
                 append( sb, "", 0 );
 527  
 
 528  0
                 append( sb, "outputDirectory (Default: ${project.build.directory})", 2 );
 529  0
                 append( sb, "The directory for the generated WAR.", 3 );
 530  0
                 append( sb, "Required: Yes", 3 );
 531  0
                 append( sb, "", 0 );
 532  
 
 533  0
                 append( sb, "outputFileNameMapping", 2 );
 534  0
                 append( sb, "The file name mapping to use when copying libraries and TLDs. If no file mapping is set (default) the files are copied with their standard names.", 3 );
 535  0
                 append( sb, "", 0 );
 536  
 
 537  0
                 append( sb, "overlays", 2 );
 538  0
                 append( sb, "The overlays to apply.", 3 );
 539  0
                 append( sb, "", 0 );
 540  
 
 541  0
                 append( sb, "packagingExcludes", 2 );
 542  0
                 append( sb, "The comma separated list of tokens to exclude from the WAR before packaging. This option may be used to implement the skinny WAR use case. Note that you can use the Java Regular Expressions engine to include and exclude specific pattern using the expression %regex[]. Hint: read the about (?!Pattern).", 3 );
 543  0
                 append( sb, "", 0 );
 544  
 
 545  0
                 append( sb, "packagingIncludes", 2 );
 546  0
                 append( sb, "The comma separated list of tokens to include in the WAR before packaging. By default everything is included. This option may be used to implement the skinny WAR use case. Note that you can use the Java Regular Expressions engine to include and exclude specific pattern using the expression %regex[].", 3 );
 547  0
                 append( sb, "", 0 );
 548  
 
 549  0
                 append( sb, "primaryArtifact (Default: true)", 2 );
 550  0
                 append( sb, "Whether this is the main artifact being built. Set to false if you don\'t want to install or deploy it to the local repository instead of the default one in an execution.", 3 );
 551  0
                 append( sb, "Expression: ${primaryArtifact}", 3 );
 552  0
                 append( sb, "", 0 );
 553  
 
 554  0
                 append( sb, "useCache (Default: false)", 2 );
 555  0
                 append( sb, "Whether the cache should be used to save the status of the webapp across multiple runs. Experimental feature so disabled by default.", 3 );
 556  0
                 append( sb, "Expression: ${useCache}", 3 );
 557  0
                 append( sb, "", 0 );
 558  
 
 559  0
                 append( sb, "warName (Default: ${project.build.finalName})", 2 );
 560  0
                 append( sb, "The name of the generated WAR.", 3 );
 561  0
                 append( sb, "Required: Yes", 3 );
 562  0
                 append( sb, "", 0 );
 563  
 
 564  0
                 append( sb, "warSourceDirectory (Default: ${basedir}/src/main/webapp)", 2 );
 565  0
                 append( sb, "Single directory for extra files to include in the WAR. This is where you place your JSP files.", 3 );
 566  0
                 append( sb, "Required: Yes", 3 );
 567  0
                 append( sb, "", 0 );
 568  
 
 569  0
                 append( sb, "warSourceExcludes", 2 );
 570  0
                 append( sb, "The comma separated list of tokens to exclude when copying the content of the warSourceDirectory.", 3 );
 571  0
                 append( sb, "", 0 );
 572  
 
 573  0
                 append( sb, "warSourceIncludes (Default: **)", 2 );
 574  0
                 append( sb, "The comma separated list of tokens to include when copying the content of the warSourceDirectory.", 3 );
 575  0
                 append( sb, "", 0 );
 576  
 
 577  0
                 append( sb, "webappDirectory (Default: ${project.build.directory}/${project.build.finalName})", 2 );
 578  0
                 append( sb, "The directory where the webapp is built.", 3 );
 579  0
                 append( sb, "Required: Yes", 3 );
 580  0
                 append( sb, "", 0 );
 581  
 
 582  0
                 append( sb, "webResources", 2 );
 583  0
                 append( sb, "The list of webResources we want to transfer.", 3 );
 584  0
                 append( sb, "", 0 );
 585  
 
 586  0
                 append( sb, "webXml", 2 );
 587  0
                 append( sb, "The path to the web.xml file to use.", 3 );
 588  0
                 append( sb, "Expression: ${maven.war.webxml}", 3 );
 589  0
                 append( sb, "", 0 );
 590  
 
 591  0
                 append( sb, "workDirectory (Default: ${project.build.directory}/war/work)", 2 );
 592  0
                 append( sb, "Directory to unpack dependent WARs into if needed.", 3 );
 593  0
                 append( sb, "Required: Yes", 3 );
 594  0
                 append( sb, "", 0 );
 595  
             }
 596  
         }
 597  
 
 598  0
         if ( getLog().isInfoEnabled() )
 599  
         {
 600  0
             getLog().info( sb.toString() );
 601  
         }
 602  0
     }
 603  
 
 604  
     /**
 605  
      * <p>Repeat a String <code>n</code> times to form a new string.</p>
 606  
      *
 607  
      * @param str String to repeat
 608  
      * @param repeat number of times to repeat str
 609  
      * @return String with repeated String
 610  
      * @throws NegativeArraySizeException if <code>repeat < 0</code>
 611  
      * @throws NullPointerException if str is <code>null</code>
 612  
      */
 613  
     private static String repeat( String str, int repeat )
 614  
     {
 615  0
         StringBuffer buffer = new StringBuffer( repeat * str.length() );
 616  
 
 617  0
         for ( int i = 0; i < repeat; i++ )
 618  
         {
 619  0
             buffer.append( str );
 620  
         }
 621  
 
 622  0
         return buffer.toString();
 623  
     }
 624  
 
 625  
     /** 
 626  
      * Append a description to the buffer by respecting the indentSize and lineLength parameters.
 627  
      * <b>Note</b>: The last character is always a new line.
 628  
      * 
 629  
      * @param sb The buffer to append the description, not <code>null</code>.
 630  
      * @param description The description, not <code>null</code>.
 631  
      * @param indent The base indentation level of each line, must not be negative.
 632  
      */
 633  
     private void append( StringBuffer sb, String description, int indent )
 634  
     {
 635  0
         for ( Iterator it = toLines( description, indent, indentSize, lineLength ).iterator(); it.hasNext(); )
 636  
         {
 637  0
             sb.append( it.next().toString() ).append( '\n' );
 638  
         }
 639  0
     }
 640  
 
 641  
     /** 
 642  
      * Splits the specified text into lines of convenient display length.
 643  
      * 
 644  
      * @param text The text to split into lines, must not be <code>null</code>.
 645  
      * @param indent The base indentation level of each line, must not be negative.
 646  
      * @param indentSize The size of each indentation, must not be negative.
 647  
      * @param lineLength The length of the line, must not be negative.
 648  
      * @return The sequence of display lines, never <code>null</code>.
 649  
      * @throws NegativeArraySizeException if <code>indent < 0</code>
 650  
      */
 651  
     private static List toLines( String text, int indent, int indentSize, int lineLength )
 652  
     {
 653  0
         List<String> lines = new ArrayList<String>();
 654  
 
 655  0
         String ind = repeat( "\t", indent );
 656  0
         String[] plainLines = text.split( "(\r\n)|(\r)|(\n)" );
 657  0
         for ( int i = 0; i < plainLines.length; i++ )
 658  
         {
 659  0
             toLines( lines, ind + plainLines[i], indentSize, lineLength );
 660  
         }
 661  
 
 662  0
         return lines;
 663  
     }
 664  
 
 665  
     /** 
 666  
      * Adds the specified line to the output sequence, performing line wrapping if necessary.
 667  
      * 
 668  
      * @param lines The sequence of display lines, must not be <code>null</code>.
 669  
      * @param line The line to add, must not be <code>null</code>.
 670  
      * @param indentSize The size of each indentation, must not be negative.
 671  
      * @param lineLength The length of the line, must not be negative.
 672  
      */
 673  
     private static void toLines( List<String> lines, String line, int indentSize, int lineLength )
 674  
     {
 675  0
         int lineIndent = getIndentLevel( line );
 676  0
         StringBuffer buf = new StringBuffer( 256 );
 677  0
         String[] tokens = line.split( " +" );
 678  0
         for ( int i = 0; i < tokens.length; i++ )
 679  
         {
 680  0
             String token = tokens[i];
 681  0
             if ( i > 0 )
 682  
             {
 683  0
                 if ( buf.length() + token.length() >= lineLength )
 684  
                 {
 685  0
                     lines.add( buf.toString() );
 686  0
                     buf.setLength( 0 );
 687  0
                     buf.append( repeat( " ", lineIndent * indentSize ) );
 688  
                 }
 689  
                 else
 690  
                 {
 691  0
                     buf.append( ' ' );
 692  
                 }
 693  
             }
 694  0
             for ( int j = 0; j < token.length(); j++ )
 695  
             {
 696  0
                 char c = token.charAt( j );
 697  0
                 if ( c == '\t' )
 698  
                 {
 699  0
                     buf.append( repeat( " ", indentSize - buf.length() % indentSize ) );
 700  
                 }
 701  0
                 else if ( c == '\u00A0' )
 702  
                 {
 703  0
                     buf.append( ' ' );
 704  
                 }
 705  
                 else
 706  
                 {
 707  0
                     buf.append( c );
 708  
                 }
 709  
             }
 710  
         }
 711  0
         lines.add( buf.toString() );
 712  0
     }
 713  
 
 714  
     /** 
 715  
      * Gets the indentation level of the specified line.
 716  
      * 
 717  
      * @param line The line whose indentation level should be retrieved, must not be <code>null</code>.
 718  
      * @return The indentation level of the line.
 719  
      */
 720  
     private static int getIndentLevel( String line )
 721  
     {
 722  0
         int level = 0;
 723  0
         for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ )
 724  
         {
 725  0
             level++;
 726  
         }
 727  0
         for ( int i = level + 1; i <= level + 4 && i < line.length(); i++ )
 728  
         {
 729  0
             if ( line.charAt( i ) == '\t' )
 730  
             {
 731  0
                 level++;
 732  0
                 break;
 733  
             }
 734  
         }
 735  0
         return level;
 736  
     }
 737  
 }