1 /* 2 =================== DO NOT EDIT THIS FILE ==================== 3 Generated by Modello 1.0.1 on 2009-09-09 03:30:24, 4 any modifications will be overwritten. 5 ============================================================== 6 */ 7 8 package org.apache.maven.model; 9 10 /** 11 * 12 * 13 * The <code><parent></code> element contains 14 * informations required to the parent project. 15 * 16 * 17 * 18 * @version $Revision$ $Date$ 19 */ 20 public class Parent 21 implements java.io.Serializable 22 { 23 24 //--------------------------/ 25 //- Class/Member Variables -/ 26 //--------------------------/ 27 28 /** 29 * The artifact id of the parent project to inherit from. 30 */ 31 private String artifactId; 32 33 /** 34 * The group id of the parent project to inherit from. 35 */ 36 private String groupId; 37 38 /** 39 * The version of the parent project to inherit. 40 */ 41 private String version; 42 43 /** 44 * 45 * 46 * The relative path of the parent 47 * <code>pom.xml</code> file within the check out. 48 * The default value is <code>../pom.xml</code>. 49 * Maven looks for the parent pom first in the 50 * reactor of currently building projects, then in this 51 * location on 52 * the filesystem, then the local repository, and 53 * lastly in the remote repo. 54 * <code>relativePath</code> allows you to select a 55 * different location, 56 * for example when your structure is flat, or 57 * deeper without an intermediate parent pom. 58 * However, the group ID, artifact ID and version 59 * are still required, 60 * and must match the file in the location given or 61 * it will revert to the repository for the POM. 62 * This feature is only for enhancing the 63 * development in a local checkout of that project. 64 * 65 * 66 */ 67 private String relativePath = "../pom.xml"; 68 69 70 //-----------/ 71 //- Methods -/ 72 //-----------/ 73 74 /** 75 * Get the artifact id of the parent project to inherit from. 76 * 77 * @return String 78 */ 79 public String getArtifactId() 80 { 81 return this.artifactId; 82 } //-- String getArtifactId() 83 84 /** 85 * Get the group id of the parent project to inherit from. 86 * 87 * @return String 88 */ 89 public String getGroupId() 90 { 91 return this.groupId; 92 } //-- String getGroupId() 93 94 /** 95 * Get the relative path of the parent <code>pom.xml</code> 96 * file within the check out. 97 * The default value is <code>../pom.xml</code>. 98 * Maven looks for the parent pom first in the 99 * reactor of currently building projects, then in this 100 * location on 101 * the filesystem, then the local repository, and 102 * lastly in the remote repo. 103 * <code>relativePath</code> allows you to select a 104 * different location, 105 * for example when your structure is flat, or 106 * deeper without an intermediate parent pom. 107 * However, the group ID, artifact ID and version 108 * are still required, 109 * and must match the file in the location given or 110 * it will revert to the repository for the POM. 111 * This feature is only for enhancing the 112 * development in a local checkout of that project. 113 * 114 * @return String 115 */ 116 public String getRelativePath() 117 { 118 return this.relativePath; 119 } //-- String getRelativePath() 120 121 /** 122 * Get the version of the parent project to inherit. 123 * 124 * @return String 125 */ 126 public String getVersion() 127 { 128 return this.version; 129 } //-- String getVersion() 130 131 /** 132 * Set the artifact id of the parent project to inherit from. 133 * 134 * @param artifactId 135 */ 136 public void setArtifactId( String artifactId ) 137 { 138 this.artifactId = artifactId; 139 } //-- void setArtifactId( String ) 140 141 /** 142 * Set the group id of the parent project to inherit from. 143 * 144 * @param groupId 145 */ 146 public void setGroupId( String groupId ) 147 { 148 this.groupId = groupId; 149 } //-- void setGroupId( String ) 150 151 /** 152 * Set the relative path of the parent <code>pom.xml</code> 153 * file within the check out. 154 * The default value is <code>../pom.xml</code>. 155 * Maven looks for the parent pom first in the 156 * reactor of currently building projects, then in this 157 * location on 158 * the filesystem, then the local repository, and 159 * lastly in the remote repo. 160 * <code>relativePath</code> allows you to select a 161 * different location, 162 * for example when your structure is flat, or 163 * deeper without an intermediate parent pom. 164 * However, the group ID, artifact ID and version 165 * are still required, 166 * and must match the file in the location given or 167 * it will revert to the repository for the POM. 168 * This feature is only for enhancing the 169 * development in a local checkout of that project. 170 * 171 * @param relativePath 172 */ 173 public void setRelativePath( String relativePath ) 174 { 175 this.relativePath = relativePath; 176 } //-- void setRelativePath( String ) 177 178 /** 179 * Set the version of the parent project to inherit. 180 * 181 * @param version 182 */ 183 public void setVersion( String version ) 184 { 185 this.version = version; 186 } //-- void setVersion( String ) 187 188 189 190 /** 191 * @return the id as <code>groupId:artifactId:version</code> 192 */ 193 public String getId() 194 { 195 StringBuffer id = new StringBuffer(); 196 197 id.append( getGroupId() ); 198 id.append( ":" ); 199 id.append( getArtifactId() ); 200 id.append( ":" ); 201 id.append( "pom" ); 202 // id.append( getPackaging() ); 203 id.append( ":" ); 204 id.append( getVersion() ); 205 206 return id.toString(); 207 } 208 209 210 }