View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.shared.release.config;
20  
21  import java.util.List;
22  
23  import org.apache.maven.model.Scm;
24  
25  /**
26   * <p>ReleaseDescriptor interface.</p>
27   *
28   * @author Robert Scholte
29   */
30  public interface ReleaseDescriptor {
31      /**
32       * Get if updateDependencies is false, dependencies version won't be updated to the next development version.
33       *
34       * @return boolean
35       */
36      boolean isUpdateDependencies();
37  
38      /**
39       * Get whether to use the release profile that adds sources and javadocs to the released artifact, if appropriate.
40       * If set to true, this will set the property "performRelease" to true.
41       *
42       * @return boolean
43       */
44      boolean isUseReleaseProfile();
45  
46      /**
47       * Get whether to use the parent pom version for submodule versions.
48       *
49       * @return boolean
50       */
51      boolean isAutoVersionSubmodules();
52  
53      /**
54       * Get whether a SNAPSHOT of the release plugin is allowed.
55       *
56       * @return boolean
57       */
58      boolean isSnapshotReleasePluginAllowed();
59  
60      /**
61       * Get the commits must be done by modules or not. Set it to true in case of flat directory structure.
62       *
63       * @return boolean
64       */
65      boolean isCommitByProject();
66  
67      /**
68       * Get whether to create a branch instead of do a release.
69       *
70       * @return boolean
71       */
72      boolean isBranchCreation();
73  
74      /**
75       * Get whether to update branch POM versions.
76       *
77       * @return boolean
78       */
79      boolean isUpdateBranchVersions();
80  
81      /**
82       * Get whether to update working copy POM versions.
83       *
84       * @return boolean
85       */
86      boolean isUpdateWorkingCopyVersions();
87  
88      /**
89       * Get whether to suppress a commit of changes to the working copy before a tag or branch is created.
90       *
91       * @return boolean
92       */
93      boolean isSuppressCommitBeforeTagOrBranch();
94  
95      /**
96       * Get should timestamped SNAPSHOT dependencies be allowed? Default is to fail when any SNAPSHOT dependency is
97       * found.
98       *
99       * @return boolean
100      */
101     boolean isAllowTimestampedSnapshots();
102 
103     /**
104      * Get whether to update branch versions to SNAPSHOT.
105      *
106      * @return boolean
107      */
108     boolean isUpdateVersionsToSnapshot();
109 
110     /**
111      * Get nOTE : currently only implemented with svn scm. Enable a workaround to prevent issue due to svn client &gt;
112      * 1.5.0 (https://issues.apache.org/jira/browse/SCM-406).
113      *
114      * @return boolean
115      */
116     boolean isRemoteTagging();
117 
118     /**
119      * Get if the scm provider should sign the tag. NOTE: currently only implemented with git-exe.
120      *
121      * @return boolean true if SCM tag should be signed
122      */
123     boolean isScmSignTags();
124 
125     /**
126      * Get if the scm provider should use local checkouts via file://${basedir} instead of doing a clean checkout over
127      * the network. This is very helpful for releasing large projects!
128      *
129      * @return boolean
130      */
131     boolean isLocalCheckout();
132 
133     /**
134      * Get should distributed changes be pushed to the central repository? For many distributed SCMs like Git, a change
135      * like a commit is only stored in your local copy of the repository. Pushing the change allows your to more easily
136      * share it with other users.
137      *
138      * @return boolean
139      */
140     boolean isPushChanges();
141 
142     /**
143      * Get default version to use for new working copy.
144      *
145      * Some SCMs may require a Work Item or a Task to allow the
146      * changes to be pushed or delivered.
147      * This field allows you to specify that Work Item
148      * or Task. It is optional, and only relevant if pushChanges is true.
149      *
150      * @return String
151      */
152     String getWorkItem();
153 
154     /**
155      * Get default version to use for new working copy.
156      *
157      * @return String
158      */
159     String getDefaultDevelopmentVersion();
160 
161     /**
162      * Get relative path of the project returned by the checkout command.
163      *
164      * @return String
165      */
166     String getScmRelativePathProjectDirectory();
167 
168     /**
169      * Get the directory where the tag will be checked out.
170      *
171      * @return String
172      */
173     String getCheckoutDirectory();
174 
175     /**
176      * Get the goals to execute in perform phase for the release.
177      *
178      * @return String
179      */
180     String getPerformGoals();
181 
182     /**
183      * Get default version to use for the tagged release or the new branch.
184      *
185      * @return String
186      */
187     String getDefaultReleaseVersion();
188 
189     /**
190      * Get nOTE : currently only implemented with svn scm. It contains the revision of the committed released pom to
191      * remotely tag the source code with this revision.
192      *
193      * @return String
194      */
195     String getScmReleasedPomRevision();
196 
197     /**
198      * Get whether to add the model schema to the top of the rewritten POM if it wasn't there already. If
199      * <code>false</code> then the root element will remain untouched.
200      *
201      * @return boolean
202      */
203     boolean isAddSchema();
204 
205     /**
206      * Get whether to generate release POMs.
207      *
208      * @return boolean
209      */
210     boolean isGenerateReleasePoms();
211 
212     /**
213      * Get whether the release process is interactive and the release manager should be prompted to confirm values, or
214      * whether the defaults are used regardless.
215      *
216      * @return boolean
217      */
218     boolean isInteractive();
219 
220     /**
221      * Get whether to use edit mode when making SCM modifications. This setting is disregarded if the SCM does not
222      * support edit mode, or if edit mode is compulsory for the given SCM.
223      *
224      * @return boolean
225      */
226     boolean isScmUseEditMode();
227 
228     /**
229      * <p>getActivateProfiles.</p>
230      *
231      * @return list of profiles to activate
232      */
233     List<String> getActivateProfiles();
234 
235     /**
236      * Get the last completed phase.
237      *
238      * @return String
239      */
240     String getCompletedPhase();
241 
242     /**
243      * Method getCheckModificationExcludes.
244      *
245      * @return List
246      */
247     List<String> getCheckModificationExcludes();
248 
249     /**
250      * Get additional arguments to pass to any executed Maven process.
251      *
252      * @return String
253      */
254     String getAdditionalArguments();
255 
256     /**
257      * Get the goals to execute in preparation for the release.
258      *
259      * @return String
260      */
261     String getPreparationGoals();
262 
263     /**
264      * Get the goals to execute in on completion of preparation for the release.
265      *
266      * @return String
267      */
268     String getCompletionGoals();
269 
270     /**
271      * Get the file name of the POM to pass to any executed Maven process.
272      *
273      * @return String
274      */
275     String getPomFileName();
276 
277     /**
278      * Get the prefix of SCM modification messages.
279      *
280      * @return String
281      */
282     String getScmCommentPrefix();
283 
284     /**
285      * Get whether to use a shallow clone with no history or a full clone containing the full history during the
286      * release.
287      *
288      * @return boolean
289      * @since 3.0.0-M6
290      */
291     boolean isScmShallowClone();
292 
293     /**
294      * Get the SCM commit comment when setting pom.xml to release.
295      *
296      * @return String
297      * @since 3.0.0-M1
298      */
299     String getScmReleaseCommitComment();
300 
301     /**
302      * Get the SCM commit comment when setting pom.xml back to development.
303      *
304      * @return String
305      * @since 3.0.0-M1
306      */
307     String getScmDevelopmentCommitComment();
308 
309     /**
310      * Get the SCM commit comment when branching.
311      *
312      * @return String
313      * @since 3.0.0-M1
314      */
315     String getScmBranchCommitComment();
316 
317     /**
318      * Get the SCM commit comment when rolling back.
319      *
320      * @return String
321      * @since 3.0.0-M1
322      */
323     String getScmRollbackCommitComment();
324 
325     /**
326      * Get pass phrase for the private key.
327      *
328      * @return String
329      */
330     String getScmPrivateKeyPassPhrase();
331 
332     /**
333      * Get the password for the user interacting with the scm.
334      *
335      * @return String
336      */
337     String getScmPassword();
338 
339     /**
340      * Get private key for an SSH based SCM repository.
341      *
342      * @return String
343      */
344     String getScmPrivateKey();
345 
346     /**
347      * Get tag or branch name: the identifier for the tag/branch. Example: maven-release-plugin-2.0.
348      *
349      * @return String
350      */
351     String getScmReleaseLabel();
352 
353     /**
354      * Get where you are going to put your tagged sources Example https://svn.apache.org/repos/asf/maven/plugins/tags.
355      *
356      * @return String
357      */
358     String getScmTagBase();
359 
360     /**
361      * Get where you are going to put your branched sources Example
362      * https://svn.apache.org/repos/asf/maven/plugins/branches.
363      *
364      * @return String
365      */
366     String getScmBranchBase();
367 
368     /**
369      * Get the id can be used to get the credentials by the server-id from the settings.xml.
370      *
371      * @return String
372      */
373     String getScmId();
374 
375     /**
376      * Get this is a MavenSCM of where you're going to get the sources to make the release with. Example:
377      * scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-release-plugin.
378      *
379      * @return String
380      */
381     String getScmSourceUrl();
382 
383     /**
384      * Get the user name to interact with the scm.
385      *
386      * @return String
387      */
388     String getScmUsername();
389 
390     /**
391      * Get wait the specified number of seconds before creating a tag.
392      *
393      * @return int
394      */
395     int getWaitBeforeTagging();
396 
397     /**
398      * Get the directory where the release is performed.
399      *
400      * @return String
401      */
402     String getWorkingDirectory();
403 
404     /**
405      * Get specifies the format for generating a tag name. Property expansion is used with the optional prefix of
406      * project, where properties are delimited with @{ and }.
407      *
408      * @return String
409      */
410     String getScmTagNameFormat();
411 
412     /**
413      * Get the role-hint for the NamingPolicy implementation used to calculate the project branch and tag names.
414      *
415      * @return String
416      */
417     String getProjectNamingPolicyId();
418 
419     /**
420      * Get the role-hint for the VersionPolicy implementation used to calculate the project versions.
421      *
422      * @return String
423      */
424     String getProjectVersionPolicyId();
425 
426     /**
427      * Get the (optional) config for the VersionPolicy implementation used to calculate the project versions.
428      *
429      * @return The parsed XML of the provided config (an instance of PlexusConfiguration) or null.
430      */
431     Object getProjectVersionPolicyConfig();
432 
433     /**
434      * Get the role-hint for the release Strategy implementation.
435      *
436      * @return String
437      */
438     String getReleaseStrategyId();
439 
440     /**
441      * <p>getDependencyOriginalVersion.</p>
442      *
443      * @return {@code String} The original version for the resolved snapshot dependency.
444      * @param artifactKey the artifact key {@code String}
445      */
446     String getDependencyOriginalVersion(String artifactKey);
447 
448     /**
449      * <p>getDependencyReleaseVersion.</p>
450      *
451      * @return {@code String} the release version for the resolved snapshot dependency.
452      * @param artifactKey the artifact key {@code String}
453      */
454     String getDependencyReleaseVersion(String artifactKey);
455 
456     /**
457      * <p>getDependencyDevelopmentVersion.</p>
458      *
459      * @return {@code String} the release version for the resolved snapshot dependency.
460      * @param artifactKey the artifact key {@code String}
461      */
462     String getDependencyDevelopmentVersion(String artifactKey);
463 
464     /**
465      * <p>getProjectOriginalVersion.</p>
466      *
467      * @param projectKey a {@link java.lang.String} object
468      * @return a {@link java.lang.String} object
469      */
470     String getProjectOriginalVersion(String projectKey);
471 
472     /**
473      * <p>getProjectDevelopmentVersion.</p>
474      *
475      * @param projectKey a {@link java.lang.String} object
476      * @return a {@link java.lang.String} object
477      */
478     String getProjectDevelopmentVersion(String projectKey);
479 
480     /**
481      * <p>getProjectReleaseVersion.</p>
482      *
483      * @param key a {@link java.lang.String} object
484      * @return a {@link java.lang.String} object
485      */
486     String getProjectReleaseVersion(String key);
487 
488     /**
489      * <p>getOriginalScmInfo.</p>
490      *
491      * @param projectKey the project key {@code String}
492      * @return the original {@code Scm} information.
493      */
494     Scm getOriginalScmInfo(String projectKey);
495 
496     /**
497      * <p>hasOriginalScmInfo.</p>
498      *
499      * @param projectKey the project key {@code String}
500      * @return has original Scm info.
501      */
502     boolean hasOriginalScmInfo(String projectKey);
503 
504     // Modifiable
505     /**
506      * <p>addDependencyOriginalVersion.</p>
507      *
508      * @param versionlessKey a {@link java.lang.String} object
509      * @param string a {@link java.lang.String} object
510      */
511     void addDependencyOriginalVersion(String versionlessKey, String string);
512 
513     /**
514      * <p>addDependencyReleaseVersion.</p>
515      *
516      * @param versionlessKey a {@link java.lang.String} object
517      * @param version a {@link java.lang.String} object
518      */
519     void addDependencyReleaseVersion(String versionlessKey, String version);
520 
521     /**
522      * <p>addDependencyDevelopmentVersion.</p>
523      *
524      * @param versionlessKey a {@link java.lang.String} object
525      * @param version a {@link java.lang.String} object
526      */
527     void addDependencyDevelopmentVersion(String versionlessKey, String version);
528 
529     /**
530      * <p>addReleaseVersion.</p>
531      *
532      * @param projectId a {@link java.lang.String} object
533      * @param nextVersion a {@link java.lang.String} object
534      */
535     void addReleaseVersion(String projectId, String nextVersion);
536 
537     /**
538      * <p>addDevelopmentVersion.</p>
539      *
540      * @param projectId a {@link java.lang.String} object
541      * @param nextVersion a {@link java.lang.String} object
542      */
543     void addDevelopmentVersion(String projectId, String nextVersion);
544 
545     /**
546      * <p>setScmReleaseLabel.</p>
547      *
548      * @param tag a {@link java.lang.String} object
549      */
550     void setScmReleaseLabel(String tag);
551 
552     /**
553      * <p>setScmReleasedPomRevision.</p>
554      *
555      * @param scmRevision a {@link java.lang.String} object
556      */
557     void setScmReleasedPomRevision(String scmRevision);
558 
559     /**
560      * <p>setScmRelativePathProjectDirectory.</p>
561      *
562      * @param scmRelativePathProjectDirectory a {@link java.lang.String} object
563      */
564     void setScmRelativePathProjectDirectory(String scmRelativePathProjectDirectory);
565 
566     /**
567      * <p>setScmSourceUrl.</p>
568      *
569      * @param scmUrl a {@link java.lang.String} object
570      */
571     void setScmSourceUrl(String scmUrl);
572 
573     /**
574      * Returns whether unresolved SNAPSHOT dependencies should automatically be resolved.
575      * If this is set, then this specifies the default answer to be used when unresolved SNAPSHOT
576      * dependencies should automatically be resolved ( 0:All 1:Project Dependencies 2:Plugins
577      * 3:Reports 4:Extensions ). Possible values are:
578      * <ul>
579      * <li>"all" or "0": resolve all kinds of snapshots, ie. project, plugin, report and extension dependencies </li>
580      * <li>"dependencies" or "1": resolve project dependencies</li>
581      * <li>"plugins" or "2": resolve plugin dependencis</li>
582      * <li>"reports" or "3": resolve report dependencies</li>
583      * <li>"extensions" or "4": resolve extension dependencies</li>
584      * </ul>
585      *
586      * @return String
587      */
588     String getAutoResolveSnapshots();
589 
590     /**
591      * Get the line separator to use in the pom.xml.
592      *
593      * @return String
594      */
595     String getLineSeparator();
596 
597     /**
598      * Determines whether the {@code --pin-externals} option in {@code svn copy} command is enabled
599      * which is new in Subversion 1.9.
600      *
601      * @return boolean
602      */
603     boolean isPinExternals();
604 }