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