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