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