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