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