1
2
3
4 package org.apache.maven.api.model;
5
6 import java.io.Serializable;
7 import java.nio.file.Path;
8 import java.util.ArrayList;
9 import java.util.Collection;
10 import java.util.Collections;
11 import java.util.HashMap;
12 import java.util.List;
13 import java.util.Map;
14 import org.apache.maven.api.annotations.Experimental;
15 import org.apache.maven.api.annotations.Generated;
16 import org.apache.maven.api.annotations.Immutable;
17 import org.apache.maven.api.annotations.Nonnull;
18 import org.apache.maven.api.annotations.NotThreadSafe;
19 import org.apache.maven.api.annotations.ThreadSafe;
20
21
22
23
24
25 @Experimental
26 @Generated @ThreadSafe @Immutable
27 public class Model
28 extends ModelBase
29 implements Serializable, InputLocationTracker
30 {
31 final String modelEncoding;
32
33
34
35 final Path pomFile;
36
37
38
39 final String modelVersion;
40
41
42
43
44
45 final Parent parent;
46
47
48
49
50
51 final String groupId;
52
53
54
55
56
57
58 final String artifactId;
59
60
61
62 final String version;
63
64
65
66
67
68
69
70
71
72 final String packaging;
73
74
75
76 final String name;
77
78
79
80
81
82
83
84 final String description;
85
86
87
88
89
90 final String url;
91
92
93
94
95
96
97
98 final String childProjectUrlInheritAppendPath;
99
100
101
102
103 final String inceptionYear;
104
105
106
107
108
109 final Organization organization;
110
111
112
113
114
115
116
117
118
119 final List<License> licenses;
120
121
122
123 final List<Developer> developers;
124
125
126
127 final List<Contributor> contributors;
128
129
130
131 final List<MailingList> mailingLists;
132
133
134
135 final Prerequisites prerequisites;
136
137
138
139 final Scm scm;
140
141
142
143 final IssueManagement issueManagement;
144
145
146
147 final CiManagement ciManagement;
148
149
150
151 final Build build;
152
153
154
155
156 final List<Profile> profiles;
157
158 final InputLocation pomFileLocation;
159
160 final InputLocation modelVersionLocation;
161
162 final InputLocation parentLocation;
163
164 final InputLocation groupIdLocation;
165
166 final InputLocation artifactIdLocation;
167
168 final InputLocation versionLocation;
169
170 final InputLocation packagingLocation;
171
172 final InputLocation nameLocation;
173
174 final InputLocation descriptionLocation;
175
176 final InputLocation urlLocation;
177
178 final InputLocation childProjectUrlInheritAppendPathLocation;
179
180 final InputLocation inceptionYearLocation;
181
182 final InputLocation organizationLocation;
183
184 final InputLocation licensesLocation;
185
186 final InputLocation developersLocation;
187
188 final InputLocation contributorsLocation;
189
190 final InputLocation mailingListsLocation;
191
192 final InputLocation prerequisitesLocation;
193
194 final InputLocation scmLocation;
195
196 final InputLocation issueManagementLocation;
197
198 final InputLocation ciManagementLocation;
199
200 final InputLocation buildLocation;
201
202 final InputLocation profilesLocation;
203
204
205
206
207
208 Model(
209 String modelEncoding,
210 Collection<String> modules,
211 DistributionManagement distributionManagement,
212 Map<String, String> properties,
213 DependencyManagement dependencyManagement,
214 Collection<Dependency> dependencies,
215 Collection<Repository> repositories,
216 Collection<Repository> pluginRepositories,
217 Reporting reporting,
218 Path pomFile,
219 String modelVersion,
220 Parent parent,
221 String groupId,
222 String artifactId,
223 String version,
224 String packaging,
225 String name,
226 String description,
227 String url,
228 String childProjectUrlInheritAppendPath,
229 String inceptionYear,
230 Organization organization,
231 Collection<License> licenses,
232 Collection<Developer> developers,
233 Collection<Contributor> contributors,
234 Collection<MailingList> mailingLists,
235 Prerequisites prerequisites,
236 Scm scm,
237 IssueManagement issueManagement,
238 CiManagement ciManagement,
239 Build build,
240 Collection<Profile> profiles,
241 Map<Object, InputLocation> locations,
242 InputLocation location,
243 InputLocation modulesLocation,
244 InputLocation distributionManagementLocation,
245 InputLocation propertiesLocation,
246 InputLocation dependencyManagementLocation,
247 InputLocation dependenciesLocation,
248 InputLocation repositoriesLocation,
249 InputLocation pluginRepositoriesLocation,
250 InputLocation reportingLocation,
251 InputLocation pomFileLocation,
252 InputLocation modelVersionLocation,
253 InputLocation parentLocation,
254 InputLocation groupIdLocation,
255 InputLocation artifactIdLocation,
256 InputLocation versionLocation,
257 InputLocation packagingLocation,
258 InputLocation nameLocation,
259 InputLocation descriptionLocation,
260 InputLocation urlLocation,
261 InputLocation childProjectUrlInheritAppendPathLocation,
262 InputLocation inceptionYearLocation,
263 InputLocation organizationLocation,
264 InputLocation licensesLocation,
265 InputLocation developersLocation,
266 InputLocation contributorsLocation,
267 InputLocation mailingListsLocation,
268 InputLocation prerequisitesLocation,
269 InputLocation scmLocation,
270 InputLocation issueManagementLocation,
271 InputLocation ciManagementLocation,
272 InputLocation buildLocation,
273 InputLocation profilesLocation
274 )
275 {
276 super(
277 modules,
278 distributionManagement,
279 properties,
280 dependencyManagement,
281 dependencies,
282 repositories,
283 pluginRepositories,
284 reporting,
285 locations,
286 location,
287 modulesLocation,
288 distributionManagementLocation,
289 propertiesLocation,
290 dependencyManagementLocation,
291 dependenciesLocation,
292 repositoriesLocation,
293 pluginRepositoriesLocation,
294 reportingLocation
295 );
296 this.modelEncoding = modelEncoding;
297 this.pomFile = pomFile;
298 this.modelVersion = modelVersion;
299 this.parent = parent;
300 this.groupId = groupId;
301 this.artifactId = artifactId;
302 this.version = version;
303 this.packaging = packaging;
304 this.name = name;
305 this.description = description;
306 this.url = url;
307 this.childProjectUrlInheritAppendPath = childProjectUrlInheritAppendPath;
308 this.inceptionYear = inceptionYear;
309 this.organization = organization;
310 this.licenses = ImmutableCollections.copy( licenses );
311 this.developers = ImmutableCollections.copy( developers );
312 this.contributors = ImmutableCollections.copy( contributors );
313 this.mailingLists = ImmutableCollections.copy( mailingLists );
314 this.prerequisites = prerequisites;
315 this.scm = scm;
316 this.issueManagement = issueManagement;
317 this.ciManagement = ciManagement;
318 this.build = build;
319 this.profiles = ImmutableCollections.copy( profiles );
320 this.pomFileLocation = pomFileLocation;
321 this.modelVersionLocation = modelVersionLocation;
322 this.parentLocation = parentLocation;
323 this.groupIdLocation = groupIdLocation;
324 this.artifactIdLocation = artifactIdLocation;
325 this.versionLocation = versionLocation;
326 this.packagingLocation = packagingLocation;
327 this.nameLocation = nameLocation;
328 this.descriptionLocation = descriptionLocation;
329 this.urlLocation = urlLocation;
330 this.childProjectUrlInheritAppendPathLocation = childProjectUrlInheritAppendPathLocation;
331 this.inceptionYearLocation = inceptionYearLocation;
332 this.organizationLocation = organizationLocation;
333 this.licensesLocation = licensesLocation;
334 this.developersLocation = developersLocation;
335 this.contributorsLocation = contributorsLocation;
336 this.mailingListsLocation = mailingListsLocation;
337 this.prerequisitesLocation = prerequisitesLocation;
338 this.scmLocation = scmLocation;
339 this.issueManagementLocation = issueManagementLocation;
340 this.ciManagementLocation = ciManagementLocation;
341 this.buildLocation = buildLocation;
342 this.profilesLocation = profilesLocation;
343 }
344
345 public String getModelEncoding()
346 {
347 return modelEncoding;
348 }
349
350
351
352
353
354
355 public Path getPomFile()
356 {
357 return this.pomFile;
358 }
359
360
361
362
363
364
365 public String getModelVersion()
366 {
367 return this.modelVersion;
368 }
369
370
371
372
373
374
375
376
377 public Parent getParent()
378 {
379 return this.parent;
380 }
381
382
383
384
385
386
387
388
389 public String getGroupId()
390 {
391 return this.groupId;
392 }
393
394
395
396
397
398
399
400
401
402 public String getArtifactId()
403 {
404 return this.artifactId;
405 }
406
407
408
409
410
411
412 public String getVersion()
413 {
414 return this.version;
415 }
416
417
418
419
420
421
422
423
424
425
426
427
428 public String getPackaging()
429 {
430 return this.packaging;
431 }
432
433
434
435
436
437
438 public String getName()
439 {
440 return this.name;
441 }
442
443
444
445
446
447
448
449
450
451
452 public String getDescription()
453 {
454 return this.description;
455 }
456
457
458
459
460
461
462
463
464 public String getUrl()
465 {
466 return this.url;
467 }
468
469
470
471
472
473
474
475
476
477
478 public String getChildProjectUrlInheritAppendPath()
479 {
480 return this.childProjectUrlInheritAppendPath;
481 }
482
483
484
485
486
487
488
489 public String getInceptionYear()
490 {
491 return this.inceptionYear;
492 }
493
494
495
496
497
498
499
500
501 public Organization getOrganization()
502 {
503 return this.organization;
504 }
505
506
507
508
509
510
511
512
513
514
515
516
517 @Nonnull
518 public List<License> getLicenses()
519 {
520 return this.licenses;
521 }
522
523
524
525
526
527
528 @Nonnull
529 public List<Developer> getDevelopers()
530 {
531 return this.developers;
532 }
533
534
535
536
537
538
539 @Nonnull
540 public List<Contributor> getContributors()
541 {
542 return this.contributors;
543 }
544
545
546
547
548
549
550 @Nonnull
551 public List<MailingList> getMailingLists()
552 {
553 return this.mailingLists;
554 }
555
556
557
558
559
560
561 public Prerequisites getPrerequisites()
562 {
563 return this.prerequisites;
564 }
565
566
567
568
569
570
571 public Scm getScm()
572 {
573 return this.scm;
574 }
575
576
577
578
579
580
581 public IssueManagement getIssueManagement()
582 {
583 return this.issueManagement;
584 }
585
586
587
588
589
590
591 public CiManagement getCiManagement()
592 {
593 return this.ciManagement;
594 }
595
596
597
598
599
600
601 public Build getBuild()
602 {
603 return this.build;
604 }
605
606
607
608
609
610
611
612 @Nonnull
613 public List<Profile> getProfiles()
614 {
615 return this.profiles;
616 }
617
618
619
620
621 public InputLocation getLocation( Object key )
622 {
623 if ( key instanceof String )
624 {
625 switch ( ( String ) key )
626 {
627 case "pomFile":
628 return pomFileLocation;
629 case "modelVersion":
630 return modelVersionLocation;
631 case "parent":
632 return parentLocation;
633 case "groupId":
634 return groupIdLocation;
635 case "artifactId":
636 return artifactIdLocation;
637 case "version":
638 return versionLocation;
639 case "packaging":
640 return packagingLocation;
641 case "name":
642 return nameLocation;
643 case "description":
644 return descriptionLocation;
645 case "url":
646 return urlLocation;
647 case "childProjectUrlInheritAppendPath":
648 return childProjectUrlInheritAppendPathLocation;
649 case "inceptionYear":
650 return inceptionYearLocation;
651 case "organization":
652 return organizationLocation;
653 case "licenses":
654 return licensesLocation;
655 case "developers":
656 return developersLocation;
657 case "contributors":
658 return contributorsLocation;
659 case "mailingLists":
660 return mailingListsLocation;
661 case "prerequisites":
662 return prerequisitesLocation;
663 case "scm":
664 return scmLocation;
665 case "issueManagement":
666 return issueManagementLocation;
667 case "ciManagement":
668 return ciManagementLocation;
669 case "build":
670 return buildLocation;
671 case "profiles":
672 return profilesLocation;
673 }
674 }
675 return super.getLocation( key );
676 }
677
678
679
680
681
682
683 @Nonnull
684 public Builder with()
685 {
686 return newBuilder( this );
687 }
688
689
690
691
692
693
694 @Nonnull
695 public Model withModules( Collection<String> modules )
696 {
697 return with().modules( modules ).build();
698 }
699
700
701
702
703
704
705 @Nonnull
706 public Model withDistributionManagement( DistributionManagement distributionManagement )
707 {
708 return with().distributionManagement( distributionManagement ).build();
709 }
710
711
712
713
714
715
716 @Nonnull
717 public Model withProperties( Map<String, String> properties )
718 {
719 return with().properties( properties ).build();
720 }
721
722
723
724
725
726
727 @Nonnull
728 public Model withDependencyManagement( DependencyManagement dependencyManagement )
729 {
730 return with().dependencyManagement( dependencyManagement ).build();
731 }
732
733
734
735
736
737
738 @Nonnull
739 public Model withDependencies( Collection<Dependency> dependencies )
740 {
741 return with().dependencies( dependencies ).build();
742 }
743
744
745
746
747
748
749 @Nonnull
750 public Model withRepositories( Collection<Repository> repositories )
751 {
752 return with().repositories( repositories ).build();
753 }
754
755
756
757
758
759
760 @Nonnull
761 public Model withPluginRepositories( Collection<Repository> pluginRepositories )
762 {
763 return with().pluginRepositories( pluginRepositories ).build();
764 }
765
766
767
768
769
770
771 @Nonnull
772 public Model withReporting( Reporting reporting )
773 {
774 return with().reporting( reporting ).build();
775 }
776
777
778
779
780
781
782 @Nonnull
783 public Model withPomFile( Path pomFile )
784 {
785 return with().pomFile( pomFile ).build();
786 }
787
788
789
790
791
792
793 @Nonnull
794 public Model withModelVersion( String modelVersion )
795 {
796 return with().modelVersion( modelVersion ).build();
797 }
798
799
800
801
802
803
804 @Nonnull
805 public Model withParent( Parent parent )
806 {
807 return with().parent( parent ).build();
808 }
809
810
811
812
813
814
815 @Nonnull
816 public Model withGroupId( String groupId )
817 {
818 return with().groupId( groupId ).build();
819 }
820
821
822
823
824
825
826 @Nonnull
827 public Model withArtifactId( String artifactId )
828 {
829 return with().artifactId( artifactId ).build();
830 }
831
832
833
834
835
836
837 @Nonnull
838 public Model withVersion( String version )
839 {
840 return with().version( version ).build();
841 }
842
843
844
845
846
847
848 @Nonnull
849 public Model withPackaging( String packaging )
850 {
851 return with().packaging( packaging ).build();
852 }
853
854
855
856
857
858
859 @Nonnull
860 public Model withName( String name )
861 {
862 return with().name( name ).build();
863 }
864
865
866
867
868
869
870 @Nonnull
871 public Model withDescription( String description )
872 {
873 return with().description( description ).build();
874 }
875
876
877
878
879
880
881 @Nonnull
882 public Model withUrl( String url )
883 {
884 return with().url( url ).build();
885 }
886
887
888
889
890
891
892 @Nonnull
893 public Model withChildProjectUrlInheritAppendPath( String childProjectUrlInheritAppendPath )
894 {
895 return with().childProjectUrlInheritAppendPath( childProjectUrlInheritAppendPath ).build();
896 }
897
898
899
900
901
902
903 @Nonnull
904 public Model withInceptionYear( String inceptionYear )
905 {
906 return with().inceptionYear( inceptionYear ).build();
907 }
908
909
910
911
912
913
914 @Nonnull
915 public Model withOrganization( Organization organization )
916 {
917 return with().organization( organization ).build();
918 }
919
920
921
922
923
924
925 @Nonnull
926 public Model withLicenses( Collection<License> licenses )
927 {
928 return with().licenses( licenses ).build();
929 }
930
931
932
933
934
935
936 @Nonnull
937 public Model withDevelopers( Collection<Developer> developers )
938 {
939 return with().developers( developers ).build();
940 }
941
942
943
944
945
946
947 @Nonnull
948 public Model withContributors( Collection<Contributor> contributors )
949 {
950 return with().contributors( contributors ).build();
951 }
952
953
954
955
956
957
958 @Nonnull
959 public Model withMailingLists( Collection<MailingList> mailingLists )
960 {
961 return with().mailingLists( mailingLists ).build();
962 }
963
964
965
966
967
968
969 @Nonnull
970 public Model withPrerequisites( Prerequisites prerequisites )
971 {
972 return with().prerequisites( prerequisites ).build();
973 }
974
975
976
977
978
979
980 @Nonnull
981 public Model withScm( Scm scm )
982 {
983 return with().scm( scm ).build();
984 }
985
986
987
988
989
990
991 @Nonnull
992 public Model withIssueManagement( IssueManagement issueManagement )
993 {
994 return with().issueManagement( issueManagement ).build();
995 }
996
997
998
999
1000
1001
1002 @Nonnull
1003 public Model withCiManagement( CiManagement ciManagement )
1004 {
1005 return with().ciManagement( ciManagement ).build();
1006 }
1007
1008
1009
1010
1011
1012
1013 @Nonnull
1014 public Model withBuild( Build build )
1015 {
1016 return with().build( build ).build();
1017 }
1018
1019
1020
1021
1022
1023
1024 @Nonnull
1025 public Model withProfiles( Collection<Profile> profiles )
1026 {
1027 return with().profiles( profiles ).build();
1028 }
1029
1030
1031
1032
1033
1034
1035
1036
1037 @Nonnull
1038 public static Model newInstance()
1039 {
1040 return newInstance( true );
1041 }
1042
1043
1044
1045
1046
1047
1048
1049
1050 @Nonnull
1051 public static Model newInstance( boolean withDefaults )
1052 {
1053 return newBuilder( withDefaults ).build();
1054 }
1055
1056
1057
1058
1059
1060
1061
1062
1063 @Nonnull
1064 public static Builder newBuilder()
1065 {
1066 return newBuilder( true );
1067 }
1068
1069
1070
1071
1072
1073
1074
1075 @Nonnull
1076 public static Builder newBuilder( boolean withDefaults )
1077 {
1078 return new Builder( withDefaults );
1079 }
1080
1081
1082
1083
1084
1085
1086
1087
1088 @Nonnull
1089 public static Builder newBuilder( Model from )
1090 {
1091 return newBuilder( from, false );
1092 }
1093
1094
1095
1096
1097
1098
1099
1100
1101 @Nonnull
1102 public static Builder newBuilder( Model from, boolean forceCopy )
1103 {
1104 return new Builder( from, forceCopy );
1105 }
1106
1107
1108
1109
1110
1111
1112 @NotThreadSafe
1113 public static class Builder
1114 extends ModelBase.Builder
1115 {
1116 Model base;
1117 String modelEncoding;
1118 Path pomFile;
1119 String modelVersion;
1120 Parent parent;
1121 String groupId;
1122 String artifactId;
1123 String version;
1124 String packaging;
1125 String name;
1126 String description;
1127 String url;
1128 String childProjectUrlInheritAppendPath;
1129 String inceptionYear;
1130 Organization organization;
1131 Collection<License> licenses;
1132 Collection<Developer> developers;
1133 Collection<Contributor> contributors;
1134 Collection<MailingList> mailingLists;
1135 Prerequisites prerequisites;
1136 Scm scm;
1137 IssueManagement issueManagement;
1138 CiManagement ciManagement;
1139 Build build;
1140 Collection<Profile> profiles;
1141
1142 Builder( boolean withDefaults )
1143 {
1144 super( withDefaults );
1145 if ( withDefaults )
1146 {
1147 this.packaging = "jar";
1148 }
1149 }
1150
1151 Builder( Model base, boolean forceCopy )
1152 {
1153 super( base, forceCopy );
1154 if ( forceCopy )
1155 {
1156 this.pomFile = base.pomFile;
1157 this.modelVersion = base.modelVersion;
1158 this.parent = base.parent;
1159 this.groupId = base.groupId;
1160 this.artifactId = base.artifactId;
1161 this.version = base.version;
1162 this.packaging = base.packaging;
1163 this.name = base.name;
1164 this.description = base.description;
1165 this.url = base.url;
1166 this.childProjectUrlInheritAppendPath = base.childProjectUrlInheritAppendPath;
1167 this.inceptionYear = base.inceptionYear;
1168 this.organization = base.organization;
1169 this.licenses = base.licenses;
1170 this.developers = base.developers;
1171 this.contributors = base.contributors;
1172 this.mailingLists = base.mailingLists;
1173 this.prerequisites = base.prerequisites;
1174 this.scm = base.scm;
1175 this.issueManagement = base.issueManagement;
1176 this.ciManagement = base.ciManagement;
1177 this.build = base.build;
1178 this.profiles = base.profiles;
1179 }
1180 else
1181 {
1182 this.base = base;
1183 }
1184 }
1185
1186 @Nonnull
1187 public Builder modelEncoding( String modelEncoding )
1188 {
1189 this.modelEncoding = modelEncoding;
1190 return this;
1191 }
1192
1193 @Nonnull
1194 public Builder modules( Collection<String> modules )
1195 {
1196 this.modules = modules;
1197 return this;
1198 }
1199
1200 @Nonnull
1201 public Builder distributionManagement( DistributionManagement distributionManagement )
1202 {
1203 this.distributionManagement = distributionManagement;
1204 return this;
1205 }
1206
1207 @Nonnull
1208 public Builder properties( Map<String, String> properties )
1209 {
1210 this.properties = properties;
1211 return this;
1212 }
1213
1214 @Nonnull
1215 public Builder dependencyManagement( DependencyManagement dependencyManagement )
1216 {
1217 this.dependencyManagement = dependencyManagement;
1218 return this;
1219 }
1220
1221 @Nonnull
1222 public Builder dependencies( Collection<Dependency> dependencies )
1223 {
1224 this.dependencies = dependencies;
1225 return this;
1226 }
1227
1228 @Nonnull
1229 public Builder repositories( Collection<Repository> repositories )
1230 {
1231 this.repositories = repositories;
1232 return this;
1233 }
1234
1235 @Nonnull
1236 public Builder pluginRepositories( Collection<Repository> pluginRepositories )
1237 {
1238 this.pluginRepositories = pluginRepositories;
1239 return this;
1240 }
1241
1242 @Nonnull
1243 public Builder reporting( Reporting reporting )
1244 {
1245 this.reporting = reporting;
1246 return this;
1247 }
1248
1249 @Nonnull
1250 public Builder pomFile( Path pomFile )
1251 {
1252 this.pomFile = pomFile;
1253 return this;
1254 }
1255
1256 @Nonnull
1257 public Builder modelVersion( String modelVersion )
1258 {
1259 this.modelVersion = modelVersion;
1260 return this;
1261 }
1262
1263 @Nonnull
1264 public Builder parent( Parent parent )
1265 {
1266 this.parent = parent;
1267 return this;
1268 }
1269
1270 @Nonnull
1271 public Builder groupId( String groupId )
1272 {
1273 this.groupId = groupId;
1274 return this;
1275 }
1276
1277 @Nonnull
1278 public Builder artifactId( String artifactId )
1279 {
1280 this.artifactId = artifactId;
1281 return this;
1282 }
1283
1284 @Nonnull
1285 public Builder version( String version )
1286 {
1287 this.version = version;
1288 return this;
1289 }
1290
1291 @Nonnull
1292 public Builder packaging( String packaging )
1293 {
1294 this.packaging = packaging;
1295 return this;
1296 }
1297
1298 @Nonnull
1299 public Builder name( String name )
1300 {
1301 this.name = name;
1302 return this;
1303 }
1304
1305 @Nonnull
1306 public Builder description( String description )
1307 {
1308 this.description = description;
1309 return this;
1310 }
1311
1312 @Nonnull
1313 public Builder url( String url )
1314 {
1315 this.url = url;
1316 return this;
1317 }
1318
1319 @Nonnull
1320 public Builder childProjectUrlInheritAppendPath( String childProjectUrlInheritAppendPath )
1321 {
1322 this.childProjectUrlInheritAppendPath = childProjectUrlInheritAppendPath;
1323 return this;
1324 }
1325
1326 @Nonnull
1327 public Builder inceptionYear( String inceptionYear )
1328 {
1329 this.inceptionYear = inceptionYear;
1330 return this;
1331 }
1332
1333 @Nonnull
1334 public Builder organization( Organization organization )
1335 {
1336 this.organization = organization;
1337 return this;
1338 }
1339
1340 @Nonnull
1341 public Builder licenses( Collection<License> licenses )
1342 {
1343 this.licenses = licenses;
1344 return this;
1345 }
1346
1347 @Nonnull
1348 public Builder developers( Collection<Developer> developers )
1349 {
1350 this.developers = developers;
1351 return this;
1352 }
1353
1354 @Nonnull
1355 public Builder contributors( Collection<Contributor> contributors )
1356 {
1357 this.contributors = contributors;
1358 return this;
1359 }
1360
1361 @Nonnull
1362 public Builder mailingLists( Collection<MailingList> mailingLists )
1363 {
1364 this.mailingLists = mailingLists;
1365 return this;
1366 }
1367
1368 @Nonnull
1369 public Builder prerequisites( Prerequisites prerequisites )
1370 {
1371 this.prerequisites = prerequisites;
1372 return this;
1373 }
1374
1375 @Nonnull
1376 public Builder scm( Scm scm )
1377 {
1378 this.scm = scm;
1379 return this;
1380 }
1381
1382 @Nonnull
1383 public Builder issueManagement( IssueManagement issueManagement )
1384 {
1385 this.issueManagement = issueManagement;
1386 return this;
1387 }
1388
1389 @Nonnull
1390 public Builder ciManagement( CiManagement ciManagement )
1391 {
1392 this.ciManagement = ciManagement;
1393 return this;
1394 }
1395
1396 @Nonnull
1397 public Builder build( Build build )
1398 {
1399 this.build = build;
1400 return this;
1401 }
1402
1403 @Nonnull
1404 public Builder profiles( Collection<Profile> profiles )
1405 {
1406 this.profiles = profiles;
1407 return this;
1408 }
1409
1410
1411 @Nonnull
1412 public Builder location( Object key, InputLocation location )
1413 {
1414 if ( location != null )
1415 {
1416 if ( this.locations == null )
1417 {
1418 this.locations = new HashMap<>();
1419 }
1420 this.locations.put( key, location );
1421 }
1422 return this;
1423 }
1424
1425 @Nonnull
1426 public Model build()
1427 {
1428 if ( base != null
1429 && ( modules == null || modules == base.modules )
1430 && ( distributionManagement == null || distributionManagement == base.distributionManagement )
1431 && ( properties == null || properties == base.properties )
1432 && ( dependencyManagement == null || dependencyManagement == base.dependencyManagement )
1433 && ( dependencies == null || dependencies == base.dependencies )
1434 && ( repositories == null || repositories == base.repositories )
1435 && ( pluginRepositories == null || pluginRepositories == base.pluginRepositories )
1436 && ( reporting == null || reporting == base.reporting )
1437 && ( pomFile == null || pomFile == base.pomFile )
1438 && ( modelVersion == null || modelVersion == base.modelVersion )
1439 && ( parent == null || parent == base.parent )
1440 && ( groupId == null || groupId == base.groupId )
1441 && ( artifactId == null || artifactId == base.artifactId )
1442 && ( version == null || version == base.version )
1443 && ( packaging == null || packaging == base.packaging )
1444 && ( name == null || name == base.name )
1445 && ( description == null || description == base.description )
1446 && ( url == null || url == base.url )
1447 && ( childProjectUrlInheritAppendPath == null || childProjectUrlInheritAppendPath == base.childProjectUrlInheritAppendPath )
1448 && ( inceptionYear == null || inceptionYear == base.inceptionYear )
1449 && ( organization == null || organization == base.organization )
1450 && ( licenses == null || licenses == base.licenses )
1451 && ( developers == null || developers == base.developers )
1452 && ( contributors == null || contributors == base.contributors )
1453 && ( mailingLists == null || mailingLists == base.mailingLists )
1454 && ( prerequisites == null || prerequisites == base.prerequisites )
1455 && ( scm == null || scm == base.scm )
1456 && ( issueManagement == null || issueManagement == base.issueManagement )
1457 && ( ciManagement == null || ciManagement == base.ciManagement )
1458 && ( build == null || build == base.build )
1459 && ( profiles == null || profiles == base.profiles )
1460 )
1461 {
1462 return base;
1463 }
1464 Map<Object, InputLocation> locations = null;
1465 InputLocation location = null;
1466 InputLocation modulesLocation = null;
1467 InputLocation distributionManagementLocation = null;
1468 InputLocation propertiesLocation = null;
1469 InputLocation dependencyManagementLocation = null;
1470 InputLocation dependenciesLocation = null;
1471 InputLocation repositoriesLocation = null;
1472 InputLocation pluginRepositoriesLocation = null;
1473 InputLocation reportingLocation = null;
1474 InputLocation pomFileLocation = null;
1475 InputLocation modelVersionLocation = null;
1476 InputLocation parentLocation = null;
1477 InputLocation groupIdLocation = null;
1478 InputLocation artifactIdLocation = null;
1479 InputLocation versionLocation = null;
1480 InputLocation packagingLocation = null;
1481 InputLocation nameLocation = null;
1482 InputLocation descriptionLocation = null;
1483 InputLocation urlLocation = null;
1484 InputLocation childProjectUrlInheritAppendPathLocation = null;
1485 InputLocation inceptionYearLocation = null;
1486 InputLocation organizationLocation = null;
1487 InputLocation licensesLocation = null;
1488 InputLocation developersLocation = null;
1489 InputLocation contributorsLocation = null;
1490 InputLocation mailingListsLocation = null;
1491 InputLocation prerequisitesLocation = null;
1492 InputLocation scmLocation = null;
1493 InputLocation issueManagementLocation = null;
1494 InputLocation ciManagementLocation = null;
1495 InputLocation buildLocation = null;
1496 InputLocation profilesLocation = null;
1497 if ( this.locations != null )
1498 {
1499 locations = this.locations;
1500 location = locations.remove( "" );
1501 modulesLocation = locations.remove( "modules" );
1502 distributionManagementLocation = locations.remove( "distributionManagement" );
1503 propertiesLocation = locations.remove( "properties" );
1504 dependencyManagementLocation = locations.remove( "dependencyManagement" );
1505 dependenciesLocation = locations.remove( "dependencies" );
1506 repositoriesLocation = locations.remove( "repositories" );
1507 pluginRepositoriesLocation = locations.remove( "pluginRepositories" );
1508 reportingLocation = locations.remove( "reporting" );
1509 pomFileLocation = locations.remove( "pomFile" );
1510 modelVersionLocation = locations.remove( "modelVersion" );
1511 parentLocation = locations.remove( "parent" );
1512 groupIdLocation = locations.remove( "groupId" );
1513 artifactIdLocation = locations.remove( "artifactId" );
1514 versionLocation = locations.remove( "version" );
1515 packagingLocation = locations.remove( "packaging" );
1516 nameLocation = locations.remove( "name" );
1517 descriptionLocation = locations.remove( "description" );
1518 urlLocation = locations.remove( "url" );
1519 childProjectUrlInheritAppendPathLocation = locations.remove( "childProjectUrlInheritAppendPath" );
1520 inceptionYearLocation = locations.remove( "inceptionYear" );
1521 organizationLocation = locations.remove( "organization" );
1522 licensesLocation = locations.remove( "licenses" );
1523 developersLocation = locations.remove( "developers" );
1524 contributorsLocation = locations.remove( "contributors" );
1525 mailingListsLocation = locations.remove( "mailingLists" );
1526 prerequisitesLocation = locations.remove( "prerequisites" );
1527 scmLocation = locations.remove( "scm" );
1528 issueManagementLocation = locations.remove( "issueManagement" );
1529 ciManagementLocation = locations.remove( "ciManagement" );
1530 buildLocation = locations.remove( "build" );
1531 profilesLocation = locations.remove( "profiles" );
1532 }
1533 return new Model(
1534 modelEncoding != null ? modelEncoding : ( base != null ? base.modelEncoding : "UTF-8" ),
1535 modules != null ? modules : ( base != null ? base.modules : null ),
1536 distributionManagement != null ? distributionManagement : ( base != null ? base.distributionManagement : null ),
1537 properties != null ? properties : ( base != null ? base.properties : null ),
1538 dependencyManagement != null ? dependencyManagement : ( base != null ? base.dependencyManagement : null ),
1539 dependencies != null ? dependencies : ( base != null ? base.dependencies : null ),
1540 repositories != null ? repositories : ( base != null ? base.repositories : null ),
1541 pluginRepositories != null ? pluginRepositories : ( base != null ? base.pluginRepositories : null ),
1542 reporting != null ? reporting : ( base != null ? base.reporting : null ),
1543 pomFile != null ? pomFile : ( base != null ? base.pomFile : null ),
1544 modelVersion != null ? modelVersion : ( base != null ? base.modelVersion : null ),
1545 parent != null ? parent : ( base != null ? base.parent : null ),
1546 groupId != null ? groupId : ( base != null ? base.groupId : null ),
1547 artifactId != null ? artifactId : ( base != null ? base.artifactId : null ),
1548 version != null ? version : ( base != null ? base.version : null ),
1549 packaging != null ? packaging : ( base != null ? base.packaging : null ),
1550 name != null ? name : ( base != null ? base.name : null ),
1551 description != null ? description : ( base != null ? base.description : null ),
1552 url != null ? url : ( base != null ? base.url : null ),
1553 childProjectUrlInheritAppendPath != null ? childProjectUrlInheritAppendPath : ( base != null ? base.childProjectUrlInheritAppendPath : null ),
1554 inceptionYear != null ? inceptionYear : ( base != null ? base.inceptionYear : null ),
1555 organization != null ? organization : ( base != null ? base.organization : null ),
1556 licenses != null ? licenses : ( base != null ? base.licenses : null ),
1557 developers != null ? developers : ( base != null ? base.developers : null ),
1558 contributors != null ? contributors : ( base != null ? base.contributors : null ),
1559 mailingLists != null ? mailingLists : ( base != null ? base.mailingLists : null ),
1560 prerequisites != null ? prerequisites : ( base != null ? base.prerequisites : null ),
1561 scm != null ? scm : ( base != null ? base.scm : null ),
1562 issueManagement != null ? issueManagement : ( base != null ? base.issueManagement : null ),
1563 ciManagement != null ? ciManagement : ( base != null ? base.ciManagement : null ),
1564 build != null ? build : ( base != null ? base.build : null ),
1565 profiles != null ? profiles : ( base != null ? base.profiles : null ),
1566 locations != null ? locations : ( base != null ? base.locations : null ),
1567 location != null ? location : ( base != null ? base.location : null ),
1568 modulesLocation != null ? modulesLocation : ( base != null ? base.modulesLocation : null ),
1569 distributionManagementLocation != null ? distributionManagementLocation : ( base != null ? base.distributionManagementLocation : null ),
1570 propertiesLocation != null ? propertiesLocation : ( base != null ? base.propertiesLocation : null ),
1571 dependencyManagementLocation != null ? dependencyManagementLocation : ( base != null ? base.dependencyManagementLocation : null ),
1572 dependenciesLocation != null ? dependenciesLocation : ( base != null ? base.dependenciesLocation : null ),
1573 repositoriesLocation != null ? repositoriesLocation : ( base != null ? base.repositoriesLocation : null ),
1574 pluginRepositoriesLocation != null ? pluginRepositoriesLocation : ( base != null ? base.pluginRepositoriesLocation : null ),
1575 reportingLocation != null ? reportingLocation : ( base != null ? base.reportingLocation : null ),
1576 pomFileLocation != null ? pomFileLocation : ( base != null ? base.pomFileLocation : null ),
1577 modelVersionLocation != null ? modelVersionLocation : ( base != null ? base.modelVersionLocation : null ),
1578 parentLocation != null ? parentLocation : ( base != null ? base.parentLocation : null ),
1579 groupIdLocation != null ? groupIdLocation : ( base != null ? base.groupIdLocation : null ),
1580 artifactIdLocation != null ? artifactIdLocation : ( base != null ? base.artifactIdLocation : null ),
1581 versionLocation != null ? versionLocation : ( base != null ? base.versionLocation : null ),
1582 packagingLocation != null ? packagingLocation : ( base != null ? base.packagingLocation : null ),
1583 nameLocation != null ? nameLocation : ( base != null ? base.nameLocation : null ),
1584 descriptionLocation != null ? descriptionLocation : ( base != null ? base.descriptionLocation : null ),
1585 urlLocation != null ? urlLocation : ( base != null ? base.urlLocation : null ),
1586 childProjectUrlInheritAppendPathLocation != null ? childProjectUrlInheritAppendPathLocation : ( base != null ? base.childProjectUrlInheritAppendPathLocation : null ),
1587 inceptionYearLocation != null ? inceptionYearLocation : ( base != null ? base.inceptionYearLocation : null ),
1588 organizationLocation != null ? organizationLocation : ( base != null ? base.organizationLocation : null ),
1589 licensesLocation != null ? licensesLocation : ( base != null ? base.licensesLocation : null ),
1590 developersLocation != null ? developersLocation : ( base != null ? base.developersLocation : null ),
1591 contributorsLocation != null ? contributorsLocation : ( base != null ? base.contributorsLocation : null ),
1592 mailingListsLocation != null ? mailingListsLocation : ( base != null ? base.mailingListsLocation : null ),
1593 prerequisitesLocation != null ? prerequisitesLocation : ( base != null ? base.prerequisitesLocation : null ),
1594 scmLocation != null ? scmLocation : ( base != null ? base.scmLocation : null ),
1595 issueManagementLocation != null ? issueManagementLocation : ( base != null ? base.issueManagementLocation : null ),
1596 ciManagementLocation != null ? ciManagementLocation : ( base != null ? base.ciManagementLocation : null ),
1597 buildLocation != null ? buildLocation : ( base != null ? base.buildLocation : null ),
1598 profilesLocation != null ? profilesLocation : ( base != null ? base.profilesLocation : null )
1599 );
1600 }
1601 }
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611 public Path getProjectDirectory()
1612 {
1613 return ( pomFile != null ) ? pomFile.getParent() : null;
1614 }
1615
1616
1617
1618
1619 public String getId()
1620 {
1621 StringBuilder id = new StringBuilder( 64 );
1622
1623 id.append( ( getGroupId() == null ) ? "[inherited]" : getGroupId() );
1624 id.append( ":" );
1625 id.append( getArtifactId() );
1626 id.append( ":" );
1627 id.append( getPackaging() );
1628 id.append( ":" );
1629 id.append( ( getVersion() == null ) ? "[inherited]" : getVersion() );
1630
1631 return id.toString();
1632 }
1633
1634 @Override
1635 public String toString()
1636 {
1637 return getId();
1638 }
1639
1640 public boolean isChildProjectUrlInheritAppendPath()
1641 {
1642 return ( getChildProjectUrlInheritAppendPath() != null ) ? Boolean.parseBoolean( getChildProjectUrlInheritAppendPath() ) : true;
1643 }
1644
1645
1646
1647 }