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