1
2
3
4
5
6
7
8 package org.apache.maven.shared.release.config;
9
10
11
12
13
14
15 @SuppressWarnings( "all" )
16 public class ReleaseDescriptor
17 implements java.io.Serializable
18 {
19
20
21
22
23
24
25
26
27
28
29 private String name;
30
31
32
33
34
35
36 private String description;
37
38
39
40
41
42
43 private String ScmCommentPrefix = "[maven-release-manager] ";
44
45
46
47
48
49
50
51
52
53 private String scmSourceUrl;
54
55
56
57
58
59
60
61
62 private String scmTagBase;
63
64
65
66
67
68
69
70
71 private String scmBranchBase;
72
73
74
75
76
77
78
79 private String scmReleaseLabel;
80
81
82
83
84
85
86
87 private String scmId;
88
89
90
91
92
93
94 private String scmUsername;
95
96
97
98
99
100
101
102 private String scmPassword;
103
104
105
106
107
108
109 private String scmPrivateKey;
110
111
112
113
114
115
116 private String scmPrivateKeyPassPhrase;
117
118
119
120
121
122
123
124
125
126 private boolean scmUseEditMode = false;
127
128
129
130
131
132
133
134 private String scmRelativePathProjectDirectory;
135
136
137
138
139 private java.util.Map releaseVersions;
140
141
142
143
144 private java.util.Map developmentVersions;
145
146
147
148
149 private java.util.Map resolvedSnapshotDependencies;
150
151
152
153
154
155
156
157 private boolean updateDependencies = true;
158
159
160
161
162
163
164
165
166
167
168 private boolean useReleaseProfile = true;
169
170
171
172
173 private java.util.Map originalScmInfo;
174
175
176
177
178
179
180 private String workingDirectory;
181
182
183
184
185
186
187 private String checkoutDirectory;
188
189
190
191
192
193
194 private String completedPhase;
195
196
197
198
199
200
201
202
203
204 private boolean addSchema = false;
205
206
207
208
209
210
211 private boolean generateReleasePoms = false;
212
213
214
215
216
217
218
219 private boolean autoVersionSubmodules = false;
220
221
222
223
224
225
226
227
228
229 private boolean interactive = true;
230
231
232
233
234
235
236
237 private boolean snapshotReleasePluginAllowed = false;
238
239
240
241
242
243
244
245 private String additionalArguments;
246
247
248
249
250
251
252
253 private String pomFileName;
254
255
256
257
258 private java.util.List<String> checkModificationExcludes;
259
260
261
262
263
264
265
266 private String preparationGoals;
267
268
269
270
271
272
273
274 private String completionGoals;
275
276
277
278
279
280
281
282 private String performGoals;
283
284
285
286
287
288
289
290 private boolean commitByProject = false;
291
292
293
294
295
296
297
298 private boolean branchCreation = false;
299
300
301
302
303
304
305 private boolean updateBranchVersions = false;
306
307
308
309
310
311
312 private boolean updateWorkingCopyVersions = true;
313
314
315
316
317
318
319 private boolean updateVersionsToSnapshot = false;
320
321
322
323
324
325
326
327 private boolean suppressCommitBeforeTagOrBranch = false;
328
329
330
331
332
333
334
335 private int waitBeforeTagging = 0;
336
337
338
339
340
341
342
343
344 private boolean allowTimestampedSnapshots = false;
345
346
347
348
349
350
351
352 private String defaultReleaseVersion;
353
354
355
356
357
358
359 private String defaultDevelopmentVersion;
360
361
362
363
364
365
366
367
368
369 private boolean remoteTagging = false;
370
371
372
373
374
375
376
377
378
379 private String scmReleasedPomRevision;
380
381
382
383
384
385
386
387
388
389
390
391
392 private boolean pushChanges = true;
393
394
395
396
397
398
399
400
401
402
403
404 private boolean localCheckout = false;
405
406
407
408
409
410
411
412
413
414
415 private String scmTagNameFormat;
416
417
418
419
420 private String modelEncoding = "UTF-8";
421
422
423
424
425
426
427
428
429
430
431
432 public void addCheckModificationExclude( String string )
433 {
434 getCheckModificationExcludes().add( string );
435 }
436
437
438
439
440
441
442
443 public void addDevelopmentVersion( Object key, String value )
444 {
445 getDevelopmentVersions().put( key, value );
446 }
447
448
449
450
451
452
453
454 public void addOriginalScmInfo( Object key, String value )
455 {
456 getOriginalScmInfo().put( key, value );
457 }
458
459
460
461
462
463
464
465 public void addReleaseVersion( Object key, String value )
466 {
467 getReleaseVersions().put( key, value );
468 }
469
470
471
472
473
474
475
476 public void addResolvedSnapshotDependency( Object key, String value )
477 {
478 getResolvedSnapshotDependencies().put( key, value );
479 }
480
481
482
483
484
485
486
487 public String getAdditionalArguments()
488 {
489 return this.additionalArguments;
490 }
491
492
493
494
495
496
497 public java.util.List<String> getCheckModificationExcludes()
498 {
499 if ( this.checkModificationExcludes == null )
500 {
501 this.checkModificationExcludes = new java.util.ArrayList<String>();
502 }
503
504 return this.checkModificationExcludes;
505 }
506
507
508
509
510
511
512 public String getCheckoutDirectory()
513 {
514 return this.checkoutDirectory;
515 }
516
517
518
519
520
521
522 public String getCompletedPhase()
523 {
524 return this.completedPhase;
525 }
526
527
528
529
530
531
532
533 public String getCompletionGoals()
534 {
535 return this.completionGoals;
536 }
537
538
539
540
541
542
543 public String getDefaultDevelopmentVersion()
544 {
545 return this.defaultDevelopmentVersion;
546 }
547
548
549
550
551
552
553
554 public String getDefaultReleaseVersion()
555 {
556 return this.defaultReleaseVersion;
557 }
558
559
560
561
562
563
564 public String getDescription()
565 {
566 return this.description;
567 }
568
569
570
571
572
573
574 public java.util.Map getDevelopmentVersions()
575 {
576 if ( this.developmentVersions == null )
577 {
578 this.developmentVersions = new java.util.HashMap();
579 }
580
581 return this.developmentVersions;
582 }
583
584
585
586
587
588
589 public String getModelEncoding()
590 {
591 return this.modelEncoding;
592 }
593
594
595
596
597
598
599 public String getName()
600 {
601 return this.name;
602 }
603
604
605
606
607
608
609 public java.util.Map getOriginalScmInfo()
610 {
611 if ( this.originalScmInfo == null )
612 {
613 this.originalScmInfo = new java.util.HashMap();
614 }
615
616 return this.originalScmInfo;
617 }
618
619
620
621
622
623
624 public String getPerformGoals()
625 {
626 return this.performGoals;
627 }
628
629
630
631
632
633
634
635 public String getPomFileName()
636 {
637 return this.pomFileName;
638 }
639
640
641
642
643
644
645 public String getPreparationGoals()
646 {
647 return this.preparationGoals;
648 }
649
650
651
652
653
654
655 public java.util.Map getReleaseVersions()
656 {
657 if ( this.releaseVersions == null )
658 {
659 this.releaseVersions = new java.util.HashMap();
660 }
661
662 return this.releaseVersions;
663 }
664
665
666
667
668
669
670 public java.util.Map getResolvedSnapshotDependencies()
671 {
672 if ( this.resolvedSnapshotDependencies == null )
673 {
674 this.resolvedSnapshotDependencies = new java.util.HashMap();
675 }
676
677 return this.resolvedSnapshotDependencies;
678 }
679
680
681
682
683
684
685
686
687 public String getScmBranchBase()
688 {
689 return this.scmBranchBase;
690 }
691
692
693
694
695
696
697 public String getScmCommentPrefix()
698 {
699 return this.ScmCommentPrefix;
700 }
701
702
703
704
705
706
707
708 public String getScmId()
709 {
710 return this.scmId;
711 }
712
713
714
715
716
717
718 public String getScmPassword()
719 {
720 return this.scmPassword;
721 }
722
723
724
725
726
727
728 public String getScmPrivateKey()
729 {
730 return this.scmPrivateKey;
731 }
732
733
734
735
736
737
738 public String getScmPrivateKeyPassPhrase()
739 {
740 return this.scmPrivateKeyPassPhrase;
741 }
742
743
744
745
746
747
748
749 public String getScmRelativePathProjectDirectory()
750 {
751 return this.scmRelativePathProjectDirectory;
752 }
753
754
755
756
757
758
759
760 public String getScmReleaseLabel()
761 {
762 return this.scmReleaseLabel;
763 }
764
765
766
767
768
769
770
771
772
773 public String getScmReleasedPomRevision()
774 {
775 return this.scmReleasedPomRevision;
776 }
777
778
779
780
781
782
783
784
785
786 public String getScmSourceUrl()
787 {
788 return this.scmSourceUrl;
789 }
790
791
792
793
794
795
796
797
798 public String getScmTagBase()
799 {
800 return this.scmTagBase;
801 }
802
803
804
805
806
807
808
809
810
811
812 public String getScmTagNameFormat()
813 {
814 return this.scmTagNameFormat;
815 }
816
817
818
819
820
821
822 public String getScmUsername()
823 {
824 return this.scmUsername;
825 }
826
827
828
829
830
831
832
833 public int getWaitBeforeTagging()
834 {
835 return this.waitBeforeTagging;
836 }
837
838
839
840
841
842
843 public String getWorkingDirectory()
844 {
845 return this.workingDirectory;
846 }
847
848
849
850
851
852
853
854
855
856 public boolean isAddSchema()
857 {
858 return this.addSchema;
859 }
860
861
862
863
864
865
866
867
868 public boolean isAllowTimestampedSnapshots()
869 {
870 return this.allowTimestampedSnapshots;
871 }
872
873
874
875
876
877
878
879 public boolean isAutoVersionSubmodules()
880 {
881 return this.autoVersionSubmodules;
882 }
883
884
885
886
887
888
889 public boolean isBranchCreation()
890 {
891 return this.branchCreation;
892 }
893
894
895
896
897
898
899
900 public boolean isCommitByProject()
901 {
902 return this.commitByProject;
903 }
904
905
906
907
908
909
910 public boolean isGenerateReleasePoms()
911 {
912 return this.generateReleasePoms;
913 }
914
915
916
917
918
919
920
921
922
923 public boolean isInteractive()
924 {
925 return this.interactive;
926 }
927
928
929
930
931
932
933
934
935
936
937
938 public boolean isLocalCheckout()
939 {
940 return this.localCheckout;
941 }
942
943
944
945
946
947
948
949
950
951
952
953
954 public boolean isPushChanges()
955 {
956 return this.pushChanges;
957 }
958
959
960
961
962
963
964
965
966 public boolean isRemoteTagging()
967 {
968 return this.remoteTagging;
969 }
970
971
972
973
974
975
976
977
978
979 public boolean isScmUseEditMode()
980 {
981 return this.scmUseEditMode;
982 }
983
984
985
986
987
988
989 public boolean isSnapshotReleasePluginAllowed()
990 {
991 return this.snapshotReleasePluginAllowed;
992 }
993
994
995
996
997
998
999
1000 public boolean isSuppressCommitBeforeTagOrBranch()
1001 {
1002 return this.suppressCommitBeforeTagOrBranch;
1003 }
1004
1005
1006
1007
1008
1009
1010 public boolean isUpdateBranchVersions()
1011 {
1012 return this.updateBranchVersions;
1013 }
1014
1015
1016
1017
1018
1019
1020
1021 public boolean isUpdateDependencies()
1022 {
1023 return this.updateDependencies;
1024 }
1025
1026
1027
1028
1029
1030
1031 public boolean isUpdateVersionsToSnapshot()
1032 {
1033 return this.updateVersionsToSnapshot;
1034 }
1035
1036
1037
1038
1039
1040
1041 public boolean isUpdateWorkingCopyVersions()
1042 {
1043 return this.updateWorkingCopyVersions;
1044 }
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054 public boolean isUseReleaseProfile()
1055 {
1056 return this.useReleaseProfile;
1057 }
1058
1059
1060
1061
1062
1063
1064 public void removeCheckModificationExclude( String string )
1065 {
1066 getCheckModificationExcludes().remove( string );
1067 }
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077 public void setAddSchema( boolean addSchema )
1078 {
1079 this.addSchema = addSchema;
1080 }
1081
1082
1083
1084
1085
1086
1087
1088 public void setAdditionalArguments( String additionalArguments )
1089 {
1090 this.additionalArguments = additionalArguments;
1091 }
1092
1093
1094
1095
1096
1097
1098
1099
1100 public void setAllowTimestampedSnapshots( boolean allowTimestampedSnapshots )
1101 {
1102 this.allowTimestampedSnapshots = allowTimestampedSnapshots;
1103 }
1104
1105
1106
1107
1108
1109
1110
1111 public void setAutoVersionSubmodules( boolean autoVersionSubmodules )
1112 {
1113 this.autoVersionSubmodules = autoVersionSubmodules;
1114 }
1115
1116
1117
1118
1119
1120
1121 public void setBranchCreation( boolean branchCreation )
1122 {
1123 this.branchCreation = branchCreation;
1124 }
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134 public void setCheckModificationExcludes( java.util.List<String> checkModificationExcludes )
1135 {
1136 this.checkModificationExcludes = checkModificationExcludes;
1137 }
1138
1139
1140
1141
1142
1143
1144 public void setCheckoutDirectory( String checkoutDirectory )
1145 {
1146 this.checkoutDirectory = checkoutDirectory;
1147 }
1148
1149
1150
1151
1152
1153
1154
1155 public void setCommitByProject( boolean commitByProject )
1156 {
1157 this.commitByProject = commitByProject;
1158 }
1159
1160
1161
1162
1163
1164
1165 public void setCompletedPhase( String completedPhase )
1166 {
1167 this.completedPhase = completedPhase;
1168 }
1169
1170
1171
1172
1173
1174
1175
1176 public void setCompletionGoals( String completionGoals )
1177 {
1178 this.completionGoals = completionGoals;
1179 }
1180
1181
1182
1183
1184
1185
1186 public void setDefaultDevelopmentVersion( String defaultDevelopmentVersion )
1187 {
1188 this.defaultDevelopmentVersion = defaultDevelopmentVersion;
1189 }
1190
1191
1192
1193
1194
1195
1196
1197 public void setDefaultReleaseVersion( String defaultReleaseVersion )
1198 {
1199 this.defaultReleaseVersion = defaultReleaseVersion;
1200 }
1201
1202
1203
1204
1205
1206
1207 public void setDescription( String description )
1208 {
1209 this.description = description;
1210 }
1211
1212
1213
1214
1215
1216
1217
1218 public void setDevelopmentVersions( java.util.Map developmentVersions )
1219 {
1220 this.developmentVersions = developmentVersions;
1221 }
1222
1223
1224
1225
1226
1227
1228 public void setGenerateReleasePoms( boolean generateReleasePoms )
1229 {
1230 this.generateReleasePoms = generateReleasePoms;
1231 }
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241 public void setInteractive( boolean interactive )
1242 {
1243 this.interactive = interactive;
1244 }
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256 public void setLocalCheckout( boolean localCheckout )
1257 {
1258 this.localCheckout = localCheckout;
1259 }
1260
1261
1262
1263
1264
1265
1266 public void setModelEncoding( String modelEncoding )
1267 {
1268 this.modelEncoding = modelEncoding;
1269 }
1270
1271
1272
1273
1274
1275
1276 public void setName( String name )
1277 {
1278 this.name = name;
1279 }
1280
1281
1282
1283
1284
1285
1286 public void setOriginalScmInfo( java.util.Map originalScmInfo )
1287 {
1288 this.originalScmInfo = originalScmInfo;
1289 }
1290
1291
1292
1293
1294
1295
1296 public void setPerformGoals( String performGoals )
1297 {
1298 this.performGoals = performGoals;
1299 }
1300
1301
1302
1303
1304
1305
1306
1307 public void setPomFileName( String pomFileName )
1308 {
1309 this.pomFileName = pomFileName;
1310 }
1311
1312
1313
1314
1315
1316
1317 public void setPreparationGoals( String preparationGoals )
1318 {
1319 this.preparationGoals = preparationGoals;
1320 }
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333 public void setPushChanges( boolean pushChanges )
1334 {
1335 this.pushChanges = pushChanges;
1336 }
1337
1338
1339
1340
1341
1342
1343
1344 public void setReleaseVersions( java.util.Map releaseVersions )
1345 {
1346 this.releaseVersions = releaseVersions;
1347 }
1348
1349
1350
1351
1352
1353
1354
1355
1356 public void setRemoteTagging( boolean remoteTagging )
1357 {
1358 this.remoteTagging = remoteTagging;
1359 }
1360
1361
1362
1363
1364
1365
1366 public void setResolvedSnapshotDependencies( java.util.Map resolvedSnapshotDependencies )
1367 {
1368 this.resolvedSnapshotDependencies = resolvedSnapshotDependencies;
1369 }
1370
1371
1372
1373
1374
1375
1376
1377
1378 public void setScmBranchBase( String scmBranchBase )
1379 {
1380 this.scmBranchBase = scmBranchBase;
1381 }
1382
1383
1384
1385
1386
1387
1388 public void setScmCommentPrefix( String ScmCommentPrefix )
1389 {
1390 this.ScmCommentPrefix = ScmCommentPrefix;
1391 }
1392
1393
1394
1395
1396
1397
1398
1399 public void setScmId( String scmId )
1400 {
1401 this.scmId = scmId;
1402 }
1403
1404
1405
1406
1407
1408
1409 public void setScmPassword( String scmPassword )
1410 {
1411 this.scmPassword = scmPassword;
1412 }
1413
1414
1415
1416
1417
1418
1419 public void setScmPrivateKey( String scmPrivateKey )
1420 {
1421 this.scmPrivateKey = scmPrivateKey;
1422 }
1423
1424
1425
1426
1427
1428
1429 public void setScmPrivateKeyPassPhrase( String scmPrivateKeyPassPhrase )
1430 {
1431 this.scmPrivateKeyPassPhrase = scmPrivateKeyPassPhrase;
1432 }
1433
1434
1435
1436
1437
1438
1439
1440 public void setScmRelativePathProjectDirectory( String scmRelativePathProjectDirectory )
1441 {
1442 this.scmRelativePathProjectDirectory = scmRelativePathProjectDirectory;
1443 }
1444
1445
1446
1447
1448
1449
1450
1451 public void setScmReleaseLabel( String scmReleaseLabel )
1452 {
1453 this.scmReleaseLabel = scmReleaseLabel;
1454 }
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464 public void setScmReleasedPomRevision( String scmReleasedPomRevision )
1465 {
1466 this.scmReleasedPomRevision = scmReleasedPomRevision;
1467 }
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477 public void setScmSourceUrl( String scmSourceUrl )
1478 {
1479 this.scmSourceUrl = scmSourceUrl;
1480 }
1481
1482
1483
1484
1485
1486
1487
1488
1489 public void setScmTagBase( String scmTagBase )
1490 {
1491 this.scmTagBase = scmTagBase;
1492 }
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503 public void setScmTagNameFormat( String scmTagNameFormat )
1504 {
1505 this.scmTagNameFormat = scmTagNameFormat;
1506 }
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516 public void setScmUseEditMode( boolean scmUseEditMode )
1517 {
1518 this.scmUseEditMode = scmUseEditMode;
1519 }
1520
1521
1522
1523
1524
1525
1526 public void setScmUsername( String scmUsername )
1527 {
1528 this.scmUsername = scmUsername;
1529 }
1530
1531
1532
1533
1534
1535
1536 public void setSnapshotReleasePluginAllowed( boolean snapshotReleasePluginAllowed )
1537 {
1538 this.snapshotReleasePluginAllowed = snapshotReleasePluginAllowed;
1539 }
1540
1541
1542
1543
1544
1545
1546
1547 public void setSuppressCommitBeforeTagOrBranch( boolean suppressCommitBeforeTagOrBranch )
1548 {
1549 this.suppressCommitBeforeTagOrBranch = suppressCommitBeforeTagOrBranch;
1550 }
1551
1552
1553
1554
1555
1556
1557 public void setUpdateBranchVersions( boolean updateBranchVersions )
1558 {
1559 this.updateBranchVersions = updateBranchVersions;
1560 }
1561
1562
1563
1564
1565
1566
1567
1568 public void setUpdateDependencies( boolean updateDependencies )
1569 {
1570 this.updateDependencies = updateDependencies;
1571 }
1572
1573
1574
1575
1576
1577
1578 public void setUpdateVersionsToSnapshot( boolean updateVersionsToSnapshot )
1579 {
1580 this.updateVersionsToSnapshot = updateVersionsToSnapshot;
1581 }
1582
1583
1584
1585
1586
1587
1588 public void setUpdateWorkingCopyVersions( boolean updateWorkingCopyVersions )
1589 {
1590 this.updateWorkingCopyVersions = updateWorkingCopyVersions;
1591 }
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601 public void setUseReleaseProfile( boolean useReleaseProfile )
1602 {
1603 this.useReleaseProfile = useReleaseProfile;
1604 }
1605
1606
1607
1608
1609
1610
1611
1612 public void setWaitBeforeTagging( int waitBeforeTagging )
1613 {
1614 this.waitBeforeTagging = waitBeforeTagging;
1615 }
1616
1617
1618
1619
1620
1621
1622 public void setWorkingDirectory( String workingDirectory )
1623 {
1624 this.workingDirectory = workingDirectory;
1625 }
1626
1627
1628 public static final String DEVELOPMENT_KEY = "dev";
1629
1630 public static final String RELEASE_KEY = "rel";
1631
1632 public static final String ORIGINAL_VERSION = "original";
1633
1634
1635
1636
1637
1638 public void mapResolvedSnapshotDependencies( String artifactName, String releaseVersion, String developmentVersion )
1639 {
1640 if ( resolvedSnapshotDependencies == null )
1641 {
1642 resolvedSnapshotDependencies = new java.util.HashMap();
1643 }
1644 else
1645 {
1646 assert !resolvedSnapshotDependencies.containsKey( artifactName );
1647 }
1648
1649 java.util.Map versionsMap = new java.util.HashMap();
1650
1651 versionsMap.put( DEVELOPMENT_KEY, developmentVersion );
1652 versionsMap.put( RELEASE_KEY, releaseVersion );
1653 resolvedSnapshotDependencies.put( artifactName, versionsMap );
1654 }
1655
1656
1657
1658
1659
1660
1661
1662 public void mapReleaseVersion( String projectId, String nextVersion )
1663 {
1664 if ( releaseVersions == null )
1665 {
1666 releaseVersions = new java.util.HashMap();
1667 }
1668
1669 releaseVersions.put( projectId, nextVersion );
1670 }
1671
1672
1673
1674
1675
1676
1677
1678 public void mapDevelopmentVersion( String projectId, String nextVersion )
1679 {
1680 if ( developmentVersions == null )
1681 {
1682 developmentVersions = new java.util.HashMap();
1683 }
1684
1685 developmentVersions.put( projectId, nextVersion );
1686 }
1687
1688
1689
1690
1691
1692
1693
1694 public void mapOriginalScmInfo( String projectId, org.apache.maven.model.Scm scm )
1695 {
1696 if ( originalScmInfo == null )
1697 {
1698 originalScmInfo = new java.util.HashMap();
1699 }
1700 else
1701 {
1702 assert !originalScmInfo.containsKey( projectId );
1703 }
1704
1705 originalScmInfo.put( projectId, scm );
1706 }
1707
1708
1709
1710
1711 private java.util.Map originalVersions;
1712
1713
1714
1715
1716
1717
1718
1719
1720 public synchronized java.util.Map<String, String> getOriginalVersions( java.util.List<org.apache.maven.project.MavenProject> reactorProjects )
1721 {
1722 if ( originalVersions == null )
1723 {
1724 originalVersions = new java.util.HashMap();
1725 for ( org.apache.maven.project.MavenProject project : reactorProjects )
1726 {
1727 originalVersions.put( org.apache.maven.artifact.ArtifactUtils.versionlessKey( project.getGroupId(),
1728 project.getArtifactId() ), project.getVersion() );
1729 }
1730 }
1731 return originalVersions;
1732 }
1733
1734
1735
1736
1737
1738 public String getDependencyDevelopmentVersion( String artifactConflictId )
1739 {
1740 if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
1741 {
1742 java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
1743 return ( String ) versionMap.get( DEVELOPMENT_KEY );
1744 }
1745 return null;
1746 }
1747
1748
1749
1750
1751
1752 public String getDependencyReleaseVersion( String artifactConflictId )
1753 {
1754 if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
1755 {
1756 java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
1757 return ( String ) versionMap.get( RELEASE_KEY );
1758 }
1759 return null;
1760 }
1761
1762 boolean safeEquals( String a, String b )
1763 {
1764 return a != null ? a.equals( b ) : b == null;
1765 }
1766
1767 public boolean equals( Object obj )
1768 {
1769 if ( this == obj )
1770 {
1771 return true;
1772 }
1773 if ( obj == null || getClass() != obj.getClass() )
1774 {
1775 return false;
1776 }
1777
1778 ReleaseDescriptor that = (ReleaseDescriptor) obj;
1779
1780 if ( updateDependencies != that.updateDependencies ||
1781 useReleaseProfile != that.useReleaseProfile ||
1782 autoVersionSubmodules != that.autoVersionSubmodules ||
1783 snapshotReleasePluginAllowed != that.snapshotReleasePluginAllowed ||
1784 commitByProject != that.commitByProject ||
1785 branchCreation != that.branchCreation ||
1786 updateBranchVersions != that.updateBranchVersions ||
1787 updateWorkingCopyVersions != that.updateWorkingCopyVersions||
1788 suppressCommitBeforeTagOrBranch != that.suppressCommitBeforeTagOrBranch ||
1789 updateVersionsToSnapshot != that.updateVersionsToSnapshot ||
1790 allowTimestampedSnapshots != that.allowTimestampedSnapshots||
1791 remoteTagging != that.remoteTagging ||
1792 localCheckout != that.localCheckout ||
1793 pushChanges != that.pushChanges
1794 )
1795 {
1796 return false;
1797 }
1798
1799 if ( !safeEquals( defaultDevelopmentVersion, that.defaultDevelopmentVersion ) ||
1800 !safeEquals( scmRelativePathProjectDirectory, that.scmRelativePathProjectDirectory ) ||
1801 !safeEquals( checkoutDirectory, that.checkoutDirectory ) ||
1802 !safeEquals( performGoals, that.performGoals ) ||
1803 !safeEquals( defaultReleaseVersion, that.defaultReleaseVersion ) ||
1804 !safeEquals( scmReleasedPomRevision, that.scmReleasedPomRevision )
1805 )
1806 {
1807 return false;
1808 }
1809
1810 if ( addSchema != that.addSchema )
1811 {
1812 return false;
1813 }
1814 if ( generateReleasePoms != that.generateReleasePoms )
1815 {
1816 return false;
1817 }
1818 if ( interactive != that.interactive )
1819 {
1820 return false;
1821 }
1822 if ( scmUseEditMode != that.scmUseEditMode )
1823 {
1824 return false;
1825 }
1826 if ( !safeEquals( completedPhase, that.completedPhase ) )
1827 {
1828 return false;
1829 }
1830 if ( ( checkModificationExcludes == null || ( checkModificationExcludes != null && checkModificationExcludes.size() == 0) ) &&
1831 ( that.checkModificationExcludes == null || ( that.checkModificationExcludes != null && that.checkModificationExcludes.size() == 0) ) )
1832 {
1833
1834 }
1835 else
1836 {
1837 if ( checkModificationExcludes != null ? !checkModificationExcludes.equals( that.checkModificationExcludes )
1838 : that.checkModificationExcludes != null )
1839 {
1840 return false;
1841 }
1842 }
1843 if ( ( developmentVersions == null || ( developmentVersions != null && developmentVersions.size() == 0) ) &&
1844 ( that.developmentVersions == null || ( that.developmentVersions != null && that.developmentVersions.size() == 0) ) )
1845 {
1846
1847 }
1848 else
1849 {
1850 if ( developmentVersions != null ? !developmentVersions.equals( that.developmentVersions )
1851 : that.developmentVersions != null )
1852 {
1853 return false;
1854 }
1855 }
1856 if ( ( originalScmInfo == null || (originalScmInfo != null && originalScmInfo.size() == 0 ) ) &&
1857 ( that.originalScmInfo == null || ( that.originalScmInfo != null && that.originalScmInfo.size() == 0 ) ) )
1858 {
1859
1860 }
1861 else
1862 {
1863 if ( originalScmInfo != null ? !compareScmCollections( that.originalScmInfo ) : that.originalScmInfo != null )
1864 {
1865 return false;
1866 }
1867 }
1868 if ( ( releaseVersions == null || ( releaseVersions != null && releaseVersions.size() == 0 ) ) &&
1869 ( that.releaseVersions == null || ( that.releaseVersions != null && that.releaseVersions.size() == 0 ) ) )
1870 {
1871
1872 }
1873 else
1874 {
1875 if ( releaseVersions != null ? !releaseVersions.equals( that.releaseVersions ) : that.releaseVersions != null )
1876 {
1877 return false;
1878 }
1879 }
1880 if ( !safeEquals( additionalArguments, that.additionalArguments ) )
1881 {
1882 return false;
1883 }
1884 if ( !safeEquals( preparationGoals, that.preparationGoals ) )
1885 {
1886 return false;
1887 }
1888 if ( !safeEquals( completionGoals, that.completionGoals ) )
1889 {
1890 return false;
1891 }
1892 if ( !safeEquals( pomFileName, that.pomFileName ) )
1893 {
1894 return false;
1895 }
1896 if ( !safeEquals( scmPrivateKeyPassPhrase, that.scmPrivateKeyPassPhrase ) )
1897 {
1898 return false;
1899 }
1900 if ( !safeEquals( scmPassword, that.scmPassword ) )
1901 {
1902 return false;
1903 }
1904 if ( !safeEquals( scmPrivateKey, that.scmPrivateKey ) )
1905 {
1906 return false;
1907 }
1908 if ( !safeEquals( scmReleaseLabel, that.scmReleaseLabel ) )
1909 {
1910 return false;
1911 }
1912 if ( !safeEquals( scmTagBase, that.scmTagBase ) )
1913 {
1914 return false;
1915 }
1916 if ( !safeEquals( scmBranchBase, that.scmBranchBase ) )
1917 {
1918 return false;
1919 }
1920 if ( !safeEquals( scmId, that.scmId ) )
1921 {
1922 return false;
1923 }
1924 if ( !safeEquals( scmSourceUrl, that.scmSourceUrl ) )
1925 {
1926 return false;
1927 }
1928 if ( !safeEquals( scmUsername, that.scmUsername ) )
1929 {
1930 return false;
1931 }
1932 if ( !safeEquals( workingDirectory, that.workingDirectory ) )
1933 {
1934 return false;
1935 }
1936 if ( !safeEquals( scmTagNameFormat, that.scmTagNameFormat ) )
1937 {
1938 return false;
1939 }
1940
1941 return true;
1942 }
1943
1944 private boolean compareScmCollections( java.util.Map that )
1945 {
1946
1947 if ( that == null && originalScmInfo == null )
1948 {
1949 return true;
1950 }
1951
1952 if ( ( that == null && originalScmInfo != null ) || ( that != null && originalScmInfo == null ) )
1953 {
1954 return false;
1955 }
1956
1957 if ( that.size() != originalScmInfo.size() )
1958 {
1959 return false;
1960 }
1961
1962 for ( java.util.Iterator i = originalScmInfo.entrySet().iterator(); i.hasNext(); )
1963 {
1964 java.util.Map.Entry entry = (java.util.Map.Entry) i.next();
1965
1966 org.apache.maven.model.Scm thatScm = (org.apache.maven.model.Scm) that.get( entry.getKey() );
1967
1968 org.apache.maven.model.Scm thisScm = (org.apache.maven.model.Scm) entry.getValue();
1969 if ( thatScm == null && thisScm == null )
1970 {
1971 return true;
1972 }
1973 else if ( thatScm == null )
1974 {
1975 return false;
1976 }
1977 else if ( thisScm == null )
1978 {
1979 return true;
1980 }
1981
1982 if ( thisScm.getConnection() != null ? !thisScm.getConnection().equals( thatScm.getConnection() )
1983 : thatScm.getConnection() != null )
1984 {
1985 return false;
1986 }
1987 if ( thisScm.getDeveloperConnection() != null ? !thisScm.getDeveloperConnection().equals(
1988 thatScm.getDeveloperConnection() ) : thatScm.getDeveloperConnection() != null )
1989 {
1990 return false;
1991 }
1992 if ( thisScm.getUrl() != null ? !thisScm.getUrl().equals( thatScm.getUrl() ) : thatScm.getUrl() != null )
1993 {
1994 return false;
1995 }
1996 if ( thisScm.getTag() != null ? !thisScm.getTag().equals( thatScm.getTag() ) : thatScm.getTag() != null )
1997 {
1998 return false;
1999 }
2000
2001 if ( thisScm instanceof org.apache.maven.shared.release.scm.IdentifiedScm && thatScm instanceof org.apache.maven.shared.release.scm.IdentifiedScm )
2002 {
2003 org.apache.maven.shared.release.scm.IdentifiedScm thisIdentifiedScm = (org.apache.maven.shared.release.scm.IdentifiedScm) thisScm;
2004 org.apache.maven.shared.release.scm.IdentifiedScm thatIdentifiedScm = (org.apache.maven.shared.release.scm.IdentifiedScm) thatScm;
2005 if ( thisIdentifiedScm.getId() != null ? !thisIdentifiedScm.getId().equals( thatIdentifiedScm.getId() ) : thatIdentifiedScm.getId() != null )
2006 {
2007 return false;
2008 }
2009 }
2010 }
2011
2012 return true;
2013 }
2014
2015 public int hashCode()
2016 {
2017 int result = completedPhase != null ? completedPhase.hashCode() : 0;
2018 result = 29 * result + ( scmReleaseLabel != null ? scmReleaseLabel.hashCode() : 0 );
2019 result = 29 * result + ( additionalArguments != null ? additionalArguments.hashCode() : 0 );
2020 result = 29 * result + ( preparationGoals != null ? preparationGoals.hashCode() : 0 );
2021 result = 29 * result + ( completionGoals != null ? completionGoals.hashCode() : 0 );
2022 result = 29 * result + ( pomFileName != null ? pomFileName.hashCode() : 0 );
2023 result = 29 * result + ( checkModificationExcludes != null ? checkModificationExcludes.hashCode() : 0 );
2024 result = 29 * result + ( scmTagBase != null ? scmTagBase.hashCode() : 0 );
2025 result = 29 * result + ( scmBranchBase != null ? scmBranchBase.hashCode() : 0 );
2026 result = 29 * result + ( scmUsername != null ? scmUsername.hashCode() : 0 );
2027 result = 29 * result + ( scmPassword != null ? scmPassword.hashCode() : 0 );
2028 result = 29 * result + ( scmId != null ? scmId.hashCode() : 0 );
2029 result = 29 * result + ( scmSourceUrl != null ? scmSourceUrl.hashCode() : 0 );
2030 result = 29 * result + ( scmPrivateKey != null ? scmPrivateKey.hashCode() : 0 );
2031 result = 29 * result + ( scmPrivateKeyPassPhrase != null ? scmPrivateKeyPassPhrase.hashCode() : 0 );
2032 result = 29 * result + ( workingDirectory != null ? workingDirectory.hashCode() : 0 );
2033 result = 29 * result + ( scmUseEditMode ? 1 : 0 );
2034 result = 29 * result + ( addSchema ? 1 : 0 );
2035 result = 29 * result + ( generateReleasePoms ? 1 : 0 );
2036 result = 29 * result + ( interactive ? 1 : 0 );
2037 result = 29 * result + ( releaseVersions != null ? releaseVersions.hashCode() : 0 );
2038 result = 29 * result + ( developmentVersions != null ? developmentVersions.hashCode() : 0 );
2039 result = 29 * result + ( originalScmInfo != null ? originalScmInfo.hashCode() : 0 );
2040 result = 29 * result + ( updateDependencies ? 1 : 0 );
2041 result = 29 * result + ( useReleaseProfile ? 1 : 0 );
2042 result = 29 * result + ( autoVersionSubmodules ? 1 : 0 );
2043 result = 29 * result + ( snapshotReleasePluginAllowed ? 1 : 0 );
2044 result = 29 * result + ( commitByProject ? 1 : 0 );
2045 result = 29 * result + ( branchCreation ? 1 : 0 );
2046 result = 29 * result + ( updateBranchVersions ? 1 : 0 );
2047 result = 29 * result + ( updateWorkingCopyVersions ? 1 : 0 );
2048 result = 29 * result + ( suppressCommitBeforeTagOrBranch ? 1 : 0 );
2049 result = 29 * result + ( updateVersionsToSnapshot ? 1 : 0 );
2050 result = 29 * result + ( allowTimestampedSnapshots ? 1 : 0 );
2051 result = 29 * result + ( remoteTagging ? 1 : 0 );
2052 result = 29 * result + ( localCheckout ? 1 : 0 );
2053 result = 29 * result + ( pushChanges ? 1 : 0 );
2054 result = 29 * result + ( defaultDevelopmentVersion != null ? defaultDevelopmentVersion.hashCode() : 0 );
2055 result = 29 * result + ( scmRelativePathProjectDirectory != null ? scmRelativePathProjectDirectory.hashCode() : 0 );
2056 result = 29 * result + ( checkoutDirectory != null ? checkoutDirectory.hashCode() : 0 );
2057 result = 29 * result + ( performGoals != null ? performGoals.hashCode() : 0 );
2058 result = 29 * result + ( defaultReleaseVersion != null ? defaultReleaseVersion.hashCode() : 0 );
2059 result = 29 * result + ( scmReleasedPomRevision != null ? scmReleasedPomRevision.hashCode() : 0 );
2060
2061 return result;
2062 }
2063
2064 }