1 /* 2 Licensed to the Apache Software Foundation (ASF) under one 3 or more contributor license agreements. See the NOTICE file 4 distributed with this work for additional information 5 regarding copyright ownership. The ASF licenses this file 6 to you under the Apache License, Version 2.0 (the 7 "License"); you may not use this file except in compliance 8 with the License. You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, 13 software distributed under the License is distributed on an 14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 KIND, either express or implied. See the License for the 16 specific language governing permissions and limitations 17 under the License. 18 =================== DO NOT EDIT THIS FILE ==================== 19 Generated by Modello 2.7.0, 20 any modifications will be overwritten. 21 ============================================================== 22 */ 23 24 package org.apache.maven.model; 25 26 /** 27 * 28 * 29 * The <code><project></code> element is the root of 30 * the descriptor. 31 * The following table lists all of the possible child 32 * elements. 33 * 34 * 35 * 36 * @version $Revision$ $Date$ 37 */ 38 @SuppressWarnings( "all" ) 39 public class Model 40 extends ModelBase 41 implements java.io.Serializable, java.lang.Cloneable 42 { 43 44 //--------------------------/ 45 //- Class/Member Variables -/ 46 //--------------------------/ 47 48 /** 49 * 50 * 51 * Declares to which version of project descriptor 52 * this POM conforms to: <code>4.0.0</code> is the only 53 * value supported by Maven 3. 54 * 55 * 56 */ 57 private String modelVersion; 58 59 /** 60 * The location of the parent project, if one exists. Values 61 * from the parent 62 * project will be the default for this project if 63 * they are left unspecified. The location 64 * is given as a group ID, artifact ID and version. 65 */ 66 private Parent parent; 67 68 /** 69 * 70 * 71 * A universally unique identifier for a project. 72 * It is normal to 73 * use a fully-qualified package name to 74 * distinguish it from other 75 * projects with a similar name (eg. 76 * <code>org.apache.maven</code>). 77 * 78 * 79 */ 80 private String groupId; 81 82 /** 83 * The identifier for this artifact that is unique within the 84 * group given by the 85 * group ID. An artifact is something that is 86 * either produced or used by a project. 87 * Examples of artifacts produced by Maven for a 88 * project include: JARs, source and binary 89 * distributions, and WARs. 90 */ 91 private String artifactId; 92 93 /** 94 * The current version of the artifact produced by this project. 95 */ 96 private String version; 97 98 /** 99 * 100 * 101 * The type of artifact this project produces, for 102 * example <code>jar</code> 103 * <code>war</code> 104 * <code>ear</code> 105 * <code>pom</code>. 106 * Plugins can create their own packaging, and 107 * therefore their own packaging types, 108 * so this list does not contain all possible 109 * types. 110 * 111 * 112 */ 113 private String packaging = "jar"; 114 115 /** 116 * The full name of the project. If not specified, the 117 * artifactId will be used. 118 */ 119 private String name; 120 121 /** 122 * A detailed description of the project, used by Maven 123 * whenever it needs to 124 * describe the project, such as on the web site. 125 * While this element can be specified as 126 * CDATA to enable the use of HTML tags within the 127 * description, it is discouraged to allow 128 * plain text representation. If you need to modify 129 * the index page of the generated web 130 * site, you are able to specify your own instead 131 * of adjusting this text. 132 */ 133 private String description; 134 135 /** 136 * 137 * 138 * The URL to the project's homepage. 139 * <br><b>Default value is</b>: parent value [+ 140 * path adjustment] + (artifactId or project.directory 141 * property), or just parent value if 142 * project's 143 * <code>child.project.url.inherit.append.path="false"</code> 144 * 145 * 146 */ 147 private String url; 148 149 /** 150 * 151 * 152 * When children inherit from project's url, append 153 * path or not? Note: While the type 154 * of this field is <code>String</code> for 155 * technical reasons, the semantic type is actually 156 * <code>Boolean</code> 157 * <br><b>Default value is</b>: <code>true</code> 158 * <br><b>Since</b>: Maven 3.6.1 159 * 160 * . 161 */ 162 private String childProjectUrlInheritAppendPath; 163 164 /** 165 * The year of the project's inception, specified with 4 166 * digits. This value is 167 * used when generating copyright notices as well 168 * as being informational. 169 */ 170 private String inceptionYear; 171 172 /** 173 * This element describes various attributes of the 174 * organization to which the 175 * project belongs. These attributes are utilized 176 * when documentation is created (for 177 * copyright notices and links). 178 */ 179 private Organization organization; 180 181 /** 182 * Field licenses. 183 */ 184 private java.util.List<License> licenses; 185 186 /** 187 * Field developers. 188 */ 189 private java.util.List<Developer> developers; 190 191 /** 192 * Field contributors. 193 */ 194 private java.util.List<Contributor> contributors; 195 196 /** 197 * Field mailingLists. 198 */ 199 private java.util.List<MailingList> mailingLists; 200 201 /** 202 * Describes the prerequisites in the build environment for 203 * this project. 204 */ 205 private Prerequisites prerequisites; 206 207 /** 208 * Specification for the SCM used by the project, such as CVS, 209 * Subversion, etc. 210 */ 211 private Scm scm; 212 213 /** 214 * The project's issue management system information. 215 */ 216 private IssueManagement issueManagement; 217 218 /** 219 * The project's continuous integration information. 220 */ 221 private CiManagement ciManagement; 222 223 /** 224 * Information required to build the project. 225 */ 226 private Build build; 227 228 /** 229 * Field profiles. 230 */ 231 private java.util.List<Profile> profiles; 232 233 /** 234 * Field modelEncoding. 235 */ 236 private String modelEncoding = "UTF-8"; 237 238 239 //-----------/ 240 //- Methods -/ 241 //-----------/ 242 243 /** 244 * Method addContributor. 245 * 246 * @param contributor a contributor object. 247 */ 248 public void addContributor( Contributor contributor ) 249 { 250 getContributors().add( contributor ); 251 } //-- void addContributor( Contributor ) 252 253 /** 254 * Method addDeveloper. 255 * 256 * @param developer a developer object. 257 */ 258 public void addDeveloper( Developer developer ) 259 { 260 getDevelopers().add( developer ); 261 } //-- void addDeveloper( Developer ) 262 263 /** 264 * Method addLicense. 265 * 266 * @param license a license object. 267 */ 268 public void addLicense( License license ) 269 { 270 getLicenses().add( license ); 271 } //-- void addLicense( License ) 272 273 /** 274 * Method addMailingList. 275 * 276 * @param mailingList a mailingList object. 277 */ 278 public void addMailingList( MailingList mailingList ) 279 { 280 getMailingLists().add( mailingList ); 281 } //-- void addMailingList( MailingList ) 282 283 /** 284 * Method addProfile. 285 * 286 * @param profile a profile object. 287 */ 288 public void addProfile( Profile profile ) 289 { 290 getProfiles().add( profile ); 291 } //-- void addProfile( Profile ) 292 293 /** 294 * Method clone. 295 * 296 * @return Model 297 */ 298 public Model clone() 299 { 300 try 301 { 302 Model copy = (Model) super.clone(); 303 304 if ( this.parent != null ) 305 { 306 copy.parent = (Parent) this.parent.clone(); 307 } 308 309 if ( this.organization != null ) 310 { 311 copy.organization = (Organization) this.organization.clone(); 312 } 313 314 if ( this.licenses != null ) 315 { 316 copy.licenses = new java.util.ArrayList<License>(); 317 for ( License item : this.licenses ) 318 { 319 copy.licenses.add( ( (License) item).clone() ); 320 } 321 } 322 323 if ( this.developers != null ) 324 { 325 copy.developers = new java.util.ArrayList<Developer>(); 326 for ( Developer item : this.developers ) 327 { 328 copy.developers.add( ( (Developer) item).clone() ); 329 } 330 } 331 332 if ( this.contributors != null ) 333 { 334 copy.contributors = new java.util.ArrayList<Contributor>(); 335 for ( Contributor item : this.contributors ) 336 { 337 copy.contributors.add( ( (Contributor) item).clone() ); 338 } 339 } 340 341 if ( this.mailingLists != null ) 342 { 343 copy.mailingLists = new java.util.ArrayList<MailingList>(); 344 for ( MailingList item : this.mailingLists ) 345 { 346 copy.mailingLists.add( ( (MailingList) item).clone() ); 347 } 348 } 349 350 if ( this.prerequisites != null ) 351 { 352 copy.prerequisites = (Prerequisites) this.prerequisites.clone(); 353 } 354 355 if ( this.scm != null ) 356 { 357 copy.scm = (Scm) this.scm.clone(); 358 } 359 360 if ( this.issueManagement != null ) 361 { 362 copy.issueManagement = (IssueManagement) this.issueManagement.clone(); 363 } 364 365 if ( this.ciManagement != null ) 366 { 367 copy.ciManagement = (CiManagement) this.ciManagement.clone(); 368 } 369 370 if ( this.build != null ) 371 { 372 copy.build = (Build) this.build.clone(); 373 } 374 375 if ( this.profiles != null ) 376 { 377 copy.profiles = new java.util.ArrayList<Profile>(); 378 for ( Profile item : this.profiles ) 379 { 380 copy.profiles.add( ( (Profile) item).clone() ); 381 } 382 } 383 384 cloneHook( copy ); 385 386 return copy; 387 } 388 catch ( java.lang.Exception ex ) 389 { 390 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName() 391 + " does not support clone()" ).initCause( ex ); 392 } 393 } //-- Model clone() 394 395 /** 396 * Get the identifier for this artifact that is unique within 397 * the group given by the 398 * group ID. An artifact is something that is 399 * either produced or used by a project. 400 * Examples of artifacts produced by Maven for a 401 * project include: JARs, source and binary 402 * distributions, and WARs. 403 * 404 * @return String 405 */ 406 public String getArtifactId() 407 { 408 return this.artifactId; 409 } //-- String getArtifactId() 410 411 /** 412 * Get information required to build the project. 413 * 414 * @return Build 415 */ 416 public Build getBuild() 417 { 418 return this.build; 419 } //-- Build getBuild() 420 421 /** 422 * Get when children inherit from project's url, append path or 423 * not? Note: While the type 424 * of this field is <code>String</code> for 425 * technical reasons, the semantic type is actually 426 * <code>Boolean</code> 427 * <br><b>Default value is</b>: <code>true</code> 428 * <br><b>Since</b>: Maven 3.6.1. 429 * 430 * @return String 431 */ 432 public String getChildProjectUrlInheritAppendPath() 433 { 434 return this.childProjectUrlInheritAppendPath; 435 } //-- String getChildProjectUrlInheritAppendPath() 436 437 /** 438 * Get the project's continuous integration information. 439 * 440 * @return CiManagement 441 */ 442 public CiManagement getCiManagement() 443 { 444 return this.ciManagement; 445 } //-- CiManagement getCiManagement() 446 447 /** 448 * Method getContributors. 449 * 450 * @return List 451 */ 452 public java.util.List<Contributor> getContributors() 453 { 454 if ( this.contributors == null ) 455 { 456 this.contributors = new java.util.ArrayList<Contributor>(); 457 } 458 459 return this.contributors; 460 } //-- java.util.List<Contributor> getContributors() 461 462 /** 463 * Get a detailed description of the project, used by Maven 464 * whenever it needs to 465 * describe the project, such as on the web site. 466 * While this element can be specified as 467 * CDATA to enable the use of HTML tags within the 468 * description, it is discouraged to allow 469 * plain text representation. If you need to modify 470 * the index page of the generated web 471 * site, you are able to specify your own instead 472 * of adjusting this text. 473 * 474 * @return String 475 */ 476 public String getDescription() 477 { 478 return this.description; 479 } //-- String getDescription() 480 481 /** 482 * Method getDevelopers. 483 * 484 * @return List 485 */ 486 public java.util.List<Developer> getDevelopers() 487 { 488 if ( this.developers == null ) 489 { 490 this.developers = new java.util.ArrayList<Developer>(); 491 } 492 493 return this.developers; 494 } //-- java.util.List<Developer> getDevelopers() 495 496 /** 497 * Get a universally unique identifier for a project. It is 498 * normal to 499 * use a fully-qualified package name to 500 * distinguish it from other 501 * projects with a similar name (eg. 502 * <code>org.apache.maven</code>). 503 * 504 * @return String 505 */ 506 public String getGroupId() 507 { 508 return this.groupId; 509 } //-- String getGroupId() 510 511 /** 512 * Get the year of the project's inception, specified with 4 513 * digits. This value is 514 * used when generating copyright notices as well 515 * as being informational. 516 * 517 * @return String 518 */ 519 public String getInceptionYear() 520 { 521 return this.inceptionYear; 522 } //-- String getInceptionYear() 523 524 /** 525 * Get the project's issue management system information. 526 * 527 * @return IssueManagement 528 */ 529 public IssueManagement getIssueManagement() 530 { 531 return this.issueManagement; 532 } //-- IssueManagement getIssueManagement() 533 534 /** 535 * Method getLicenses. 536 * 537 * @return List 538 */ 539 public java.util.List<License> getLicenses() 540 { 541 if ( this.licenses == null ) 542 { 543 this.licenses = new java.util.ArrayList<License>(); 544 } 545 546 return this.licenses; 547 } //-- java.util.List<License> getLicenses() 548 549 /** 550 * Method getMailingLists. 551 * 552 * @return List 553 */ 554 public java.util.List<MailingList> getMailingLists() 555 { 556 if ( this.mailingLists == null ) 557 { 558 this.mailingLists = new java.util.ArrayList<MailingList>(); 559 } 560 561 return this.mailingLists; 562 } //-- java.util.List<MailingList> getMailingLists() 563 564 /** 565 * Get the modelEncoding field. 566 * 567 * @return String 568 */ 569 public String getModelEncoding() 570 { 571 return this.modelEncoding; 572 } //-- String getModelEncoding() 573 574 /** 575 * Get declares to which version of project descriptor this POM 576 * conforms to: <code>4.0.0</code> is the only 577 * value supported by Maven 3. 578 * 579 * @return String 580 */ 581 public String getModelVersion() 582 { 583 return this.modelVersion; 584 } //-- String getModelVersion() 585 586 /** 587 * Get the full name of the project. If not specified, the 588 * artifactId will be used. 589 * 590 * @return String 591 */ 592 public String getName() 593 { 594 return this.name; 595 } //-- String getName() 596 597 /** 598 * Get this element describes various attributes of the 599 * organization to which the 600 * project belongs. These attributes are utilized 601 * when documentation is created (for 602 * copyright notices and links). 603 * 604 * @return Organization 605 */ 606 public Organization getOrganization() 607 { 608 return this.organization; 609 } //-- Organization getOrganization() 610 611 /** 612 * Get the type of artifact this project produces, for example 613 * <code>jar</code> 614 * <code>war</code> 615 * <code>ear</code> 616 * <code>pom</code>. 617 * Plugins can create their own packaging, and 618 * therefore their own packaging types, 619 * so this list does not contain all possible 620 * types. 621 * 622 * @return String 623 */ 624 public String getPackaging() 625 { 626 return this.packaging; 627 } //-- String getPackaging() 628 629 /** 630 * Get the location of the parent project, if one exists. 631 * Values from the parent 632 * project will be the default for this project if 633 * they are left unspecified. The location 634 * is given as a group ID, artifact ID and version. 635 * 636 * @return Parent 637 */ 638 public Parent getParent() 639 { 640 return this.parent; 641 } //-- Parent getParent() 642 643 /** 644 * Get describes the prerequisites in the build environment for 645 * this project. 646 * 647 * @return Prerequisites 648 */ 649 public Prerequisites getPrerequisites() 650 { 651 return this.prerequisites; 652 } //-- Prerequisites getPrerequisites() 653 654 /** 655 * Method getProfiles. 656 * 657 * @return List 658 */ 659 public java.util.List<Profile> getProfiles() 660 { 661 if ( this.profiles == null ) 662 { 663 this.profiles = new java.util.ArrayList<Profile>(); 664 } 665 666 return this.profiles; 667 } //-- java.util.List<Profile> getProfiles() 668 669 /** 670 * Get specification for the SCM used by the project, such as 671 * CVS, Subversion, etc. 672 * 673 * @return Scm 674 */ 675 public Scm getScm() 676 { 677 return this.scm; 678 } //-- Scm getScm() 679 680 /** 681 * Get the URL to the project's homepage. 682 * <br><b>Default value is</b>: parent value [+ 683 * path adjustment] + (artifactId or project.directory 684 * property), or just parent value if 685 * project's 686 * <code>child.project.url.inherit.append.path="false"</code> 687 * 688 * @return String 689 */ 690 public String getUrl() 691 { 692 return this.url; 693 } //-- String getUrl() 694 695 /** 696 * Get the current version of the artifact produced by this 697 * project. 698 * 699 * @return String 700 */ 701 public String getVersion() 702 { 703 return this.version; 704 } //-- String getVersion() 705 706 /** 707 * Method removeContributor. 708 * 709 * @param contributor a contributor object. 710 */ 711 public void removeContributor( Contributor contributor ) 712 { 713 getContributors().remove( contributor ); 714 } //-- void removeContributor( Contributor ) 715 716 /** 717 * Method removeDeveloper. 718 * 719 * @param developer a developer object. 720 */ 721 public void removeDeveloper( Developer developer ) 722 { 723 getDevelopers().remove( developer ); 724 } //-- void removeDeveloper( Developer ) 725 726 /** 727 * Method removeLicense. 728 * 729 * @param license a license object. 730 */ 731 public void removeLicense( License license ) 732 { 733 getLicenses().remove( license ); 734 } //-- void removeLicense( License ) 735 736 /** 737 * Method removeMailingList. 738 * 739 * @param mailingList a mailingList object. 740 */ 741 public void removeMailingList( MailingList mailingList ) 742 { 743 getMailingLists().remove( mailingList ); 744 } //-- void removeMailingList( MailingList ) 745 746 /** 747 * Method removeProfile. 748 * 749 * @param profile a profile object. 750 */ 751 public void removeProfile( Profile profile ) 752 { 753 getProfiles().remove( profile ); 754 } //-- void removeProfile( Profile ) 755 756 /** 757 * Set the identifier for this artifact that is unique within 758 * the group given by the 759 * group ID. An artifact is something that is 760 * either produced or used by a project. 761 * Examples of artifacts produced by Maven for a 762 * project include: JARs, source and binary 763 * distributions, and WARs. 764 * 765 * @param artifactId a artifactId object. 766 */ 767 public void setArtifactId( String artifactId ) 768 { 769 this.artifactId = artifactId; 770 } //-- void setArtifactId( String ) 771 772 /** 773 * Set information required to build the project. 774 * 775 * @param build a build object. 776 */ 777 public void setBuild( Build build ) 778 { 779 this.build = build; 780 } //-- void setBuild( Build ) 781 782 /** 783 * Set when children inherit from project's url, append path or 784 * not? Note: While the type 785 * of this field is <code>String</code> for 786 * technical reasons, the semantic type is actually 787 * <code>Boolean</code> 788 * <br><b>Default value is</b>: <code>true</code> 789 * <br><b>Since</b>: Maven 3.6.1. 790 * 791 * @param childProjectUrlInheritAppendPath a 792 * childProjectUrlInheritAppendPath object. 793 */ 794 public void setChildProjectUrlInheritAppendPath( String childProjectUrlInheritAppendPath ) 795 { 796 this.childProjectUrlInheritAppendPath = childProjectUrlInheritAppendPath; 797 } //-- void setChildProjectUrlInheritAppendPath( String ) 798 799 /** 800 * Set the project's continuous integration information. 801 * 802 * @param ciManagement a ciManagement object. 803 */ 804 public void setCiManagement( CiManagement ciManagement ) 805 { 806 this.ciManagement = ciManagement; 807 } //-- void setCiManagement( CiManagement ) 808 809 /** 810 * Set describes the contributors to a project that are not yet 811 * committers. 812 * 813 * @param contributors a contributors object. 814 */ 815 public void setContributors( java.util.List<Contributor> contributors ) 816 { 817 this.contributors = contributors; 818 } //-- void setContributors( java.util.List ) 819 820 /** 821 * Set a detailed description of the project, used by Maven 822 * whenever it needs to 823 * describe the project, such as on the web site. 824 * While this element can be specified as 825 * CDATA to enable the use of HTML tags within the 826 * description, it is discouraged to allow 827 * plain text representation. If you need to modify 828 * the index page of the generated web 829 * site, you are able to specify your own instead 830 * of adjusting this text. 831 * 832 * @param description a description object. 833 */ 834 public void setDescription( String description ) 835 { 836 this.description = description; 837 } //-- void setDescription( String ) 838 839 /** 840 * Set describes the committers of a project. 841 * 842 * @param developers a developers object. 843 */ 844 public void setDevelopers( java.util.List<Developer> developers ) 845 { 846 this.developers = developers; 847 } //-- void setDevelopers( java.util.List ) 848 849 /** 850 * Set a universally unique identifier for a project. It is 851 * normal to 852 * use a fully-qualified package name to 853 * distinguish it from other 854 * projects with a similar name (eg. 855 * <code>org.apache.maven</code>). 856 * 857 * @param groupId a groupId object. 858 */ 859 public void setGroupId( String groupId ) 860 { 861 this.groupId = groupId; 862 } //-- void setGroupId( String ) 863 864 /** 865 * Set the year of the project's inception, specified with 4 866 * digits. This value is 867 * used when generating copyright notices as well 868 * as being informational. 869 * 870 * @param inceptionYear a inceptionYear object. 871 */ 872 public void setInceptionYear( String inceptionYear ) 873 { 874 this.inceptionYear = inceptionYear; 875 } //-- void setInceptionYear( String ) 876 877 /** 878 * Set the project's issue management system information. 879 * 880 * @param issueManagement a issueManagement object. 881 */ 882 public void setIssueManagement( IssueManagement issueManagement ) 883 { 884 this.issueManagement = issueManagement; 885 } //-- void setIssueManagement( IssueManagement ) 886 887 /** 888 * Set this element describes all of the licenses for this 889 * project. 890 * Each license is described by a 891 * <code>license</code> element, which 892 * is then described by additional elements. 893 * Projects should only list the license(s) that 894 * applies to the project 895 * and not the licenses that apply to dependencies. 896 * If multiple licenses are listed, it is assumed 897 * that the user can select 898 * any of them, not that they must accept all. 899 * 900 * @param licenses a licenses object. 901 */ 902 public void setLicenses( java.util.List<License> licenses ) 903 { 904 this.licenses = licenses; 905 } //-- void setLicenses( java.util.List ) 906 907 /** 908 * Set contains information about a project's mailing lists. 909 * 910 * @param mailingLists a mailingLists object. 911 */ 912 public void setMailingLists( java.util.List<MailingList> mailingLists ) 913 { 914 this.mailingLists = mailingLists; 915 } //-- void setMailingLists( java.util.List ) 916 917 /** 918 * Set the modelEncoding field. 919 * 920 * @param modelEncoding a modelEncoding object. 921 */ 922 public void setModelEncoding( String modelEncoding ) 923 { 924 this.modelEncoding = modelEncoding; 925 } //-- void setModelEncoding( String ) 926 927 /** 928 * Set declares to which version of project descriptor this POM 929 * conforms to: <code>4.0.0</code> is the only 930 * value supported by Maven 3. 931 * 932 * @param modelVersion a modelVersion object. 933 */ 934 public void setModelVersion( String modelVersion ) 935 { 936 this.modelVersion = modelVersion; 937 } //-- void setModelVersion( String ) 938 939 /** 940 * Set the full name of the project. If not specified, the 941 * artifactId will be used. 942 * 943 * @param name a name object. 944 */ 945 public void setName( String name ) 946 { 947 this.name = name; 948 } //-- void setName( String ) 949 950 /** 951 * Set this element describes various attributes of the 952 * organization to which the 953 * project belongs. These attributes are utilized 954 * when documentation is created (for 955 * copyright notices and links). 956 * 957 * @param organization a organization object. 958 */ 959 public void setOrganization( Organization organization ) 960 { 961 this.organization = organization; 962 } //-- void setOrganization( Organization ) 963 964 /** 965 * Set the type of artifact this project produces, for example 966 * <code>jar</code> 967 * <code>war</code> 968 * <code>ear</code> 969 * <code>pom</code>. 970 * Plugins can create their own packaging, and 971 * therefore their own packaging types, 972 * so this list does not contain all possible 973 * types. 974 * 975 * @param packaging a packaging object. 976 */ 977 public void setPackaging( String packaging ) 978 { 979 this.packaging = packaging; 980 } //-- void setPackaging( String ) 981 982 /** 983 * Set the location of the parent project, if one exists. 984 * Values from the parent 985 * project will be the default for this project if 986 * they are left unspecified. The location 987 * is given as a group ID, artifact ID and version. 988 * 989 * @param parent a parent object. 990 */ 991 public void setParent( Parent parent ) 992 { 993 this.parent = parent; 994 } //-- void setParent( Parent ) 995 996 /** 997 * Set describes the prerequisites in the build environment for 998 * this project. 999 * 1000 * @param prerequisites a prerequisites object. 1001 */ 1002 public void setPrerequisites( Prerequisites prerequisites ) 1003 { 1004 this.prerequisites = prerequisites; 1005 } //-- void setPrerequisites( Prerequisites ) 1006 1007 /** 1008 * Set a listing of project-local build profiles which will 1009 * modify the build process 1010 * when activated. 1011 * 1012 * @param profiles a profiles object. 1013 */ 1014 public void setProfiles( java.util.List<Profile> profiles ) 1015 { 1016 this.profiles = profiles; 1017 } //-- void setProfiles( java.util.List ) 1018 1019 /** 1020 * Set specification for the SCM used by the project, such as 1021 * CVS, Subversion, etc. 1022 * 1023 * @param scm a scm object. 1024 */ 1025 public void setScm( Scm scm ) 1026 { 1027 this.scm = scm; 1028 } //-- void setScm( Scm ) 1029 1030 /** 1031 * Set the URL to the project's homepage. 1032 * <br><b>Default value is</b>: parent value [+ 1033 * path adjustment] + (artifactId or project.directory 1034 * property), or just parent value if 1035 * project's 1036 * <code>child.project.url.inherit.append.path="false"</code> 1037 * 1038 * @param url a url object. 1039 */ 1040 public void setUrl( String url ) 1041 { 1042 this.url = url; 1043 } //-- void setUrl( String ) 1044 1045 /** 1046 * Set the current version of the artifact produced by this 1047 * project. 1048 * 1049 * @param version a version object. 1050 */ 1051 public void setVersion( String version ) 1052 { 1053 this.version = version; 1054 } //-- void setVersion( String ) 1055 1056 1057 1058 private void cloneHook( Model copy ) 1059 { 1060 copy.pomFile = pomFile; 1061 } 1062 1063 /** 1064 * The POM from which this model originated. This is transient runtime state and therefore not managed by Modello. 1065 */ 1066 private java.io.File pomFile; 1067 1068 /** 1069 * Gets the POM file for the corresponding project (if any). 1070 * 1071 * @return The POM file from which this model originated or {@code null} if this model does not belong to a local 1072 * project (e.g. describes the metadata of some artifact from the repository). 1073 */ 1074 public java.io.File getPomFile() 1075 { 1076 return pomFile; 1077 } 1078 1079 public void setPomFile( java.io.File pomFile ) 1080 { 1081 this.pomFile = ( pomFile != null ) ? pomFile.getAbsoluteFile() : null; 1082 } 1083 1084 /** 1085 * Gets the base directory for the corresponding project (if any). 1086 * 1087 * @return The base directory for the corresponding project or {@code null} if this model does not belong to a local 1088 * project (e.g. describes the metadata of some artifact from the repository). 1089 */ 1090 public java.io.File getProjectDirectory() 1091 { 1092 return ( pomFile != null ) ? pomFile.getParentFile() : null; 1093 } 1094 1095 /** 1096 * @return the model id as <code>groupId:artifactId:packaging:version</code> 1097 */ 1098 public String getId() 1099 { 1100 StringBuilder id = new StringBuilder( 64 ); 1101 1102 id.append( ( getGroupId() == null ) ? "[inherited]" : getGroupId() ); 1103 id.append( ":" ); 1104 id.append( getArtifactId() ); 1105 id.append( ":" ); 1106 id.append( getPackaging() ); 1107 id.append( ":" ); 1108 id.append( ( getVersion() == null ) ? "[inherited]" : getVersion() ); 1109 1110 return id.toString(); 1111 } 1112 1113 @Override 1114 public String toString() 1115 { 1116 return getId(); 1117 } 1118 1119 1120 1121 1122 1123 public boolean isChildProjectUrlInheritAppendPath() 1124 { 1125 return ( childProjectUrlInheritAppendPath != null ) ? Boolean.parseBoolean( childProjectUrlInheritAppendPath ) : true; 1126 } 1127 1128 public void setChildProjectUrlInheritAppendPath( boolean childProjectUrlInheritAppendPath ) 1129 { 1130 this.childProjectUrlInheritAppendPath = String.valueOf( childProjectUrlInheritAppendPath ); 1131 } 1132 1133 1134 1135 }