1 package org.apache.maven.report.projectinfo;
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 public class HelpMojo
20 extends AbstractMojo
21 {
22
23
24
25
26
27 private boolean detail;
28
29
30
31
32
33
34 private java.lang.String goal;
35
36
37
38
39
40
41 private int lineLength;
42
43
44
45
46
47
48 private int indentSize;
49
50
51
52 public void execute()
53 throws MojoExecutionException
54 {
55 if ( lineLength <= 0 )
56 {
57 getLog().warn( "The parameter 'lineLength' should be positive, using '80' as default." );
58 lineLength = 80;
59 }
60 if ( indentSize <= 0 )
61 {
62 getLog().warn( "The parameter 'indentSize' should be positive, using '2' as default." );
63 indentSize = 2;
64 }
65
66 StringBuffer sb = new StringBuffer();
67
68 append( sb, "org.apache.maven.plugins:maven-project-info-reports-plugin:2.4", 0 );
69 append( sb, "", 0 );
70
71 append( sb, "Maven Project Info Reports Plugin", 0 );
72 append( sb, "The Maven Project Info Reports Plugin is a plugin that generates standard reports for the specified project.", 1 );
73 append( sb, "", 0 );
74
75 if ( goal == null || goal.length() <= 0 )
76 {
77 append( sb, "This plugin has 16 goals:", 0 );
78 append( sb, "", 0 );
79 }
80
81 if ( goal == null || goal.length() <= 0 || "cim".equals( goal ) )
82 {
83 append( sb, "project-info-reports:cim", 0 );
84 append( sb, "Generates the Project Continuous Integration System report.", 1 );
85 append( sb, "", 0 );
86 if ( detail )
87 {
88 append( sb, "Available parameters:", 1 );
89 append( sb, "", 0 );
90
91 append( sb, "customBundle", 2 );
92 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
93 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
94 append( sb, "", 0 );
95
96 append( sb, "outputDirectory", 2 );
97 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
98 append( sb, "Required: Yes", 3 );
99 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
100 append( sb, "", 0 );
101
102 append( sb, "remoteRepositories", 2 );
103 append( sb, "Remote repositories used for the project.", 3 );
104 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
105 append( sb, "", 0 );
106 }
107 }
108
109 if ( goal == null || goal.length() <= 0 || "dependencies".equals( goal ) )
110 {
111 append( sb, "project-info-reports:dependencies", 0 );
112 append( sb, "Generates the Project Dependencies report.", 1 );
113 append( sb, "", 0 );
114 if ( detail )
115 {
116 append( sb, "Available parameters:", 1 );
117 append( sb, "", 0 );
118
119 append( sb, "customBundle", 2 );
120 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
121 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
122 append( sb, "", 0 );
123
124 append( sb, "dependencyDetailsEnabled (Default: true)", 2 );
125 append( sb, "Display file details for each dependency, such as: file size, number of classes, number of packages etc.", 3 );
126 append( sb, "Expression: ${dependency.details.enabled}", 3 );
127 append( sb, "", 0 );
128
129 append( sb, "dependencyLocationsEnabled (Default: true)", 2 );
130 append( sb, "Display the repository locations of the dependencies. If Maven is configured to be offline, this parameter will be ignored.", 3 );
131 append( sb, "Expression: ${dependency.locations.enabled}", 3 );
132 append( sb, "", 0 );
133
134 append( sb, "outputDirectory", 2 );
135 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
136 append( sb, "Required: Yes", 3 );
137 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
138 append( sb, "", 0 );
139
140 append( sb, "remoteRepositories", 2 );
141 append( sb, "Remote repositories used for the project.", 3 );
142 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
143 append( sb, "", 0 );
144 }
145 }
146
147 if ( goal == null || goal.length() <= 0 || "dependency-convergence".equals( goal ) )
148 {
149 append( sb, "project-info-reports:dependency-convergence", 0 );
150 append( sb, "Generates the Dependency Convergence report for reactor builds.", 1 );
151 append( sb, "", 0 );
152 if ( detail )
153 {
154 append( sb, "Available parameters:", 1 );
155 append( sb, "", 0 );
156
157 append( sb, "customBundle", 2 );
158 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
159 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
160 append( sb, "", 0 );
161
162 append( sb, "outputDirectory", 2 );
163 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
164 append( sb, "Required: Yes", 3 );
165 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
166 append( sb, "", 0 );
167
168 append( sb, "remoteRepositories", 2 );
169 append( sb, "Remote repositories used for the project.", 3 );
170 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
171 append( sb, "", 0 );
172 }
173 }
174
175 if ( goal == null || goal.length() <= 0 || "dependency-management".equals( goal ) )
176 {
177 append( sb, "project-info-reports:dependency-management", 0 );
178 append( sb, "Generates the Project Dependency Management report.", 1 );
179 append( sb, "", 0 );
180 if ( detail )
181 {
182 append( sb, "Available parameters:", 1 );
183 append( sb, "", 0 );
184
185 append( sb, "customBundle", 2 );
186 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
187 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
188 append( sb, "", 0 );
189
190 append( sb, "outputDirectory", 2 );
191 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
192 append( sb, "Required: Yes", 3 );
193 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
194 append( sb, "", 0 );
195
196 append( sb, "remoteRepositories", 2 );
197 append( sb, "Remote repositories used for the project.", 3 );
198 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
199 append( sb, "", 0 );
200 }
201 }
202
203 if ( goal == null || goal.length() <= 0 || "distribution-management".equals( goal ) )
204 {
205 append( sb, "project-info-reports:distribution-management", 0 );
206 append( sb, "Generates the Project Distribution Management report.", 1 );
207 append( sb, "", 0 );
208 if ( detail )
209 {
210 append( sb, "Available parameters:", 1 );
211 append( sb, "", 0 );
212
213 append( sb, "customBundle", 2 );
214 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
215 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
216 append( sb, "", 0 );
217
218 append( sb, "outputDirectory", 2 );
219 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
220 append( sb, "Required: Yes", 3 );
221 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
222 append( sb, "", 0 );
223
224 append( sb, "remoteRepositories", 2 );
225 append( sb, "Remote repositories used for the project.", 3 );
226 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
227 append( sb, "", 0 );
228 }
229 }
230
231 if ( goal == null || goal.length() <= 0 || "help".equals( goal ) )
232 {
233 append( sb, "project-info-reports:help", 0 );
234 append( sb, "Display help information on maven-project-info-reports-plugin.\nCall\n\u00a0\u00a0mvn\u00a0project-info-reports:help\u00a0-Ddetail=true\u00a0-Dgoal=<goal-name>\nto display parameter details.", 1 );
235 append( sb, "", 0 );
236 if ( detail )
237 {
238 append( sb, "Available parameters:", 1 );
239 append( sb, "", 0 );
240
241 append( sb, "detail (Default: false)", 2 );
242 append( sb, "If true, display all settable properties for each goal.", 3 );
243 append( sb, "Expression: ${detail}", 3 );
244 append( sb, "", 0 );
245
246 append( sb, "goal", 2 );
247 append( sb, "The name of the goal for which to show help. If unspecified, all goals will be displayed.", 3 );
248 append( sb, "Expression: ${goal}", 3 );
249 append( sb, "", 0 );
250
251 append( sb, "indentSize (Default: 2)", 2 );
252 append( sb, "The number of spaces per indentation level, should be positive.", 3 );
253 append( sb, "Expression: ${indentSize}", 3 );
254 append( sb, "", 0 );
255
256 append( sb, "lineLength (Default: 80)", 2 );
257 append( sb, "The maximum length of a display line, should be positive.", 3 );
258 append( sb, "Expression: ${lineLength}", 3 );
259 append( sb, "", 0 );
260 }
261 }
262
263 if ( goal == null || goal.length() <= 0 || "index".equals( goal ) )
264 {
265 append( sb, "project-info-reports:index", 0 );
266 append( sb, "Generates the project index page.", 1 );
267 append( sb, "", 0 );
268 if ( detail )
269 {
270 append( sb, "Available parameters:", 1 );
271 append( sb, "", 0 );
272
273 append( sb, "customBundle", 2 );
274 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
275 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
276 append( sb, "", 0 );
277
278 append( sb, "outputDirectory", 2 );
279 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
280 append( sb, "Required: Yes", 3 );
281 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
282 append( sb, "", 0 );
283
284 append( sb, "remoteRepositories", 2 );
285 append( sb, "Remote repositories used for the project.", 3 );
286 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
287 append( sb, "", 0 );
288 }
289 }
290
291 if ( goal == null || goal.length() <= 0 || "issue-tracking".equals( goal ) )
292 {
293 append( sb, "project-info-reports:issue-tracking", 0 );
294 append( sb, "Generates the Project Issue Tracking report.", 1 );
295 append( sb, "", 0 );
296 if ( detail )
297 {
298 append( sb, "Available parameters:", 1 );
299 append( sb, "", 0 );
300
301 append( sb, "customBundle", 2 );
302 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
303 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
304 append( sb, "", 0 );
305
306 append( sb, "outputDirectory", 2 );
307 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
308 append( sb, "Required: Yes", 3 );
309 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
310 append( sb, "", 0 );
311
312 append( sb, "remoteRepositories", 2 );
313 append( sb, "Remote repositories used for the project.", 3 );
314 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
315 append( sb, "", 0 );
316 }
317 }
318
319 if ( goal == null || goal.length() <= 0 || "license".equals( goal ) )
320 {
321 append( sb, "project-info-reports:license", 0 );
322 append( sb, "Generates the Project License report.", 1 );
323 append( sb, "", 0 );
324 if ( detail )
325 {
326 append( sb, "Available parameters:", 1 );
327 append( sb, "", 0 );
328
329 append( sb, "customBundle", 2 );
330 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
331 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
332 append( sb, "", 0 );
333
334 append( sb, "linkOnly (Default: false)", 2 );
335 append( sb, "Whether the only render links to the license documents instead of inlining them.\nIf the system is in offline mode, the linkOnly parameter will be always true.", 3 );
336 append( sb, "", 0 );
337
338 append( sb, "offline", 2 );
339 append( sb, "Whether the system is currently offline.", 3 );
340 append( sb, "Expression: ${settings.offline}", 3 );
341 append( sb, "", 0 );
342
343 append( sb, "outputDirectory", 2 );
344 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
345 append( sb, "Required: Yes", 3 );
346 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
347 append( sb, "", 0 );
348
349 append( sb, "remoteRepositories", 2 );
350 append( sb, "Remote repositories used for the project.", 3 );
351 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
352 append( sb, "", 0 );
353 }
354 }
355
356 if ( goal == null || goal.length() <= 0 || "mailing-list".equals( goal ) )
357 {
358 append( sb, "project-info-reports:mailing-list", 0 );
359 append( sb, "Generates the Mailing List report.", 1 );
360 append( sb, "", 0 );
361 if ( detail )
362 {
363 append( sb, "Available parameters:", 1 );
364 append( sb, "", 0 );
365
366 append( sb, "customBundle", 2 );
367 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
368 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
369 append( sb, "", 0 );
370
371 append( sb, "introduction", 2 );
372 append( sb, "Deprecated. since 2.3, you should use a custom bundle.", 3 );
373 append( sb, "", 0 );
374 append( sb, "This can override the header text of the mailing list(s) report", 3 );
375 append( sb, "", 0 );
376
377 append( sb, "outputDirectory", 2 );
378 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
379 append( sb, "Required: Yes", 3 );
380 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
381 append( sb, "", 0 );
382
383 append( sb, "remoteRepositories", 2 );
384 append( sb, "Remote repositories used for the project.", 3 );
385 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
386 append( sb, "", 0 );
387 }
388 }
389
390 if ( goal == null || goal.length() <= 0 || "modules".equals( goal ) )
391 {
392 append( sb, "project-info-reports:modules", 0 );
393 append( sb, "Generates the Project Modules report.", 1 );
394 append( sb, "", 0 );
395 if ( detail )
396 {
397 append( sb, "Available parameters:", 1 );
398 append( sb, "", 0 );
399
400 append( sb, "customBundle", 2 );
401 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
402 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
403 append( sb, "", 0 );
404
405 append( sb, "outputDirectory", 2 );
406 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
407 append( sb, "Required: Yes", 3 );
408 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
409 append( sb, "", 0 );
410
411 append( sb, "remoteRepositories", 2 );
412 append( sb, "Remote repositories used for the project.", 3 );
413 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
414 append( sb, "", 0 );
415 }
416 }
417
418 if ( goal == null || goal.length() <= 0 || "plugin-management".equals( goal ) )
419 {
420 append( sb, "project-info-reports:plugin-management", 0 );
421 append( sb, "Generates the Project Plugin Management report.", 1 );
422 append( sb, "", 0 );
423 if ( detail )
424 {
425 append( sb, "Available parameters:", 1 );
426 append( sb, "", 0 );
427
428 append( sb, "customBundle", 2 );
429 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
430 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
431 append( sb, "", 0 );
432
433 append( sb, "outputDirectory", 2 );
434 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
435 append( sb, "Required: Yes", 3 );
436 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
437 append( sb, "", 0 );
438
439 append( sb, "remoteRepositories", 2 );
440 append( sb, "Remote repositories used for the project.", 3 );
441 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
442 append( sb, "", 0 );
443 }
444 }
445
446 if ( goal == null || goal.length() <= 0 || "plugins".equals( goal ) )
447 {
448 append( sb, "project-info-reports:plugins", 0 );
449 append( sb, "Generates the Project Plugins report.", 1 );
450 append( sb, "", 0 );
451 if ( detail )
452 {
453 append( sb, "Available parameters:", 1 );
454 append( sb, "", 0 );
455
456 append( sb, "customBundle", 2 );
457 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
458 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
459 append( sb, "", 0 );
460
461 append( sb, "outputDirectory", 2 );
462 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
463 append( sb, "Required: Yes", 3 );
464 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
465 append( sb, "", 0 );
466
467 append( sb, "remoteRepositories", 2 );
468 append( sb, "Remote repositories used for the project.", 3 );
469 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
470 append( sb, "", 0 );
471 }
472 }
473
474 if ( goal == null || goal.length() <= 0 || "project-team".equals( goal ) )
475 {
476 append( sb, "project-info-reports:project-team", 0 );
477 append( sb, "Generates the Project Team report.", 1 );
478 append( sb, "", 0 );
479 if ( detail )
480 {
481 append( sb, "Available parameters:", 1 );
482 append( sb, "", 0 );
483
484 append( sb, "customBundle", 2 );
485 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
486 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
487 append( sb, "", 0 );
488
489 append( sb, "outputDirectory", 2 );
490 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
491 append( sb, "Required: Yes", 3 );
492 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
493 append( sb, "", 0 );
494
495 append( sb, "remoteRepositories", 2 );
496 append( sb, "Remote repositories used for the project.", 3 );
497 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
498 append( sb, "", 0 );
499 }
500 }
501
502 if ( goal == null || goal.length() <= 0 || "scm".equals( goal ) )
503 {
504 append( sb, "project-info-reports:scm", 0 );
505 append( sb, "Generates the Project Source Code Management (SCM) report.", 1 );
506 append( sb, "", 0 );
507 if ( detail )
508 {
509 append( sb, "Available parameters:", 1 );
510 append( sb, "", 0 );
511
512 append( sb, "anonymousConnection (Default: ${project.scm.connection})", 2 );
513 append( sb, "The SCM anonymous connection url respecting the SCM URL Format.", 3 );
514 append( sb, "", 0 );
515
516 append( sb, "checkoutDirectoryName (Default: ${project.artifactId})", 2 );
517 append( sb, "The directory name to checkout right after the SCM URL.", 3 );
518 append( sb, "Required: Yes", 3 );
519 append( sb, "", 0 );
520
521 append( sb, "customBundle", 2 );
522 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
523 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
524 append( sb, "", 0 );
525
526 append( sb, "developerConnection (Default: ${project.scm.developerConnection})", 2 );
527 append( sb, "The SCM developer connection url respecting the SCM URL Format.", 3 );
528 append( sb, "", 0 );
529
530 append( sb, "outputDirectory", 2 );
531 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
532 append( sb, "Required: Yes", 3 );
533 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
534 append( sb, "", 0 );
535
536 append( sb, "remoteRepositories", 2 );
537 append( sb, "Remote repositories used for the project.", 3 );
538 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
539 append( sb, "", 0 );
540
541 append( sb, "webAccessUrl (Default: ${project.scm.url})", 2 );
542 append( sb, "The SCM web access url.", 3 );
543 append( sb, "", 0 );
544 }
545 }
546
547 if ( goal == null || goal.length() <= 0 || "summary".equals( goal ) )
548 {
549 append( sb, "project-info-reports:summary", 0 );
550 append( sb, "Generates the project information reports summary.", 1 );
551 append( sb, "", 0 );
552 if ( detail )
553 {
554 append( sb, "Available parameters:", 1 );
555 append( sb, "", 0 );
556
557 append( sb, "customBundle", 2 );
558 append( sb, "Path for a custom bundle instead of using the default one.\nUsing this field, you could change the texts in the generated reports.", 3 );
559 append( sb, "Expression: ${project.basedir}/src/site/custom/project-info-report.properties", 3 );
560 append( sb, "", 0 );
561
562 append( sb, "outputDirectory", 2 );
563 append( sb, "The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.", 3 );
564 append( sb, "Required: Yes", 3 );
565 append( sb, "Expression: ${project.reporting.outputDirectory}", 3 );
566 append( sb, "", 0 );
567
568 append( sb, "remoteRepositories", 2 );
569 append( sb, "Remote repositories used for the project.", 3 );
570 append( sb, "Expression: ${project.remoteArtifactRepositories}", 3 );
571 append( sb, "", 0 );
572 }
573 }
574
575 if ( getLog().isInfoEnabled() )
576 {
577 getLog().info( sb.toString() );
578 }
579 }
580
581
582
583
584
585
586
587
588
589
590 private static String repeat( String str, int repeat )
591 {
592 StringBuffer buffer = new StringBuffer( repeat * str.length() );
593
594 for ( int i = 0; i < repeat; i++ )
595 {
596 buffer.append( str );
597 }
598
599 return buffer.toString();
600 }
601
602
603
604
605
606
607
608
609
610 private void append( StringBuffer sb, String description, int indent )
611 {
612 for ( Iterator it = toLines( description, indent, indentSize, lineLength ).iterator(); it.hasNext(); )
613 {
614 sb.append( it.next().toString() ).append( '\n' );
615 }
616 }
617
618
619
620
621
622
623
624
625
626
627
628 private static List toLines( String text, int indent, int indentSize, int lineLength )
629 {
630 List lines = new ArrayList();
631
632 String ind = repeat( "\t", indent );
633 String[] plainLines = text.split( "(\r\n)|(\r)|(\n)" );
634 for ( int i = 0; i < plainLines.length; i++ )
635 {
636 toLines( lines, ind + plainLines[i], indentSize, lineLength );
637 }
638
639 return lines;
640 }
641
642
643
644
645
646
647
648
649
650 private static void toLines( List lines, String line, int indentSize, int lineLength )
651 {
652 int lineIndent = getIndentLevel( line );
653 StringBuffer buf = new StringBuffer( 256 );
654 String[] tokens = line.split( " +" );
655 for ( int i = 0; i < tokens.length; i++ )
656 {
657 String token = tokens[i];
658 if ( i > 0 )
659 {
660 if ( buf.length() + token.length() >= lineLength )
661 {
662 lines.add( buf.toString() );
663 buf.setLength( 0 );
664 buf.append( repeat( " ", lineIndent * indentSize ) );
665 }
666 else
667 {
668 buf.append( ' ' );
669 }
670 }
671 for ( int j = 0; j < token.length(); j++ )
672 {
673 char c = token.charAt( j );
674 if ( c == '\t' )
675 {
676 buf.append( repeat( " ", indentSize - buf.length() % indentSize ) );
677 }
678 else if ( c == '\u00A0' )
679 {
680 buf.append( ' ' );
681 }
682 else
683 {
684 buf.append( c );
685 }
686 }
687 }
688 lines.add( buf.toString() );
689 }
690
691
692
693
694
695
696
697 private static int getIndentLevel( String line )
698 {
699 int level = 0;
700 for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ )
701 {
702 level++;
703 }
704 for ( int i = level + 1; i <= level + 4 && i < line.length(); i++ )
705 {
706 if ( line.charAt( i ) == '\t' )
707 {
708 level++;
709 break;
710 }
711 }
712 return level;
713 }
714 }