1 /* 2 =================== DO NOT EDIT THIS FILE ==================== 3 Generated by Modello 1.4 on 2012-11-23 17:40:29, 4 any modifications will be overwritten. 5 ============================================================== 6 */ 7 8 package org.apache.maven.plugin.invoker.model; 9 10 /** 11 * 12 * Describes a build job processed by the Maven Invoker 13 * Plugin. A build job can consist of a pre-build hook script, 14 * one ore more invocations of Maven and a post-build hook 15 * script. 16 * 17 * 18 * @version $Revision$ $Date$ 19 */ 20 @SuppressWarnings( "all" ) 21 public class BuildJob 22 implements java.io.Serializable 23 { 24 25 //--------------------------/ 26 //- Class/Member Variables -/ 27 //--------------------------/ 28 29 /** 30 * The path to the project to build. This path is usually 31 * relative and can denote both a POM file or a project 32 * directory. 33 */ 34 private String project; 35 36 /** 37 * The name of this build job. 38 */ 39 private String name; 40 41 /** 42 * The description of this build job. 43 */ 44 private String description; 45 46 /** 47 * The result of this build job. 48 */ 49 private String result; 50 51 /** 52 * Any failure message(s) in case this build job failed. 53 */ 54 private String failureMessage; 55 56 /** 57 * The number of seconds that this build job took to complete. 58 */ 59 private double time = 0.0; 60 61 /** 62 * The type of the build job. 63 */ 64 private String type; 65 66 /** 67 * Field modelEncoding. 68 */ 69 private String modelEncoding = "UTF-8"; 70 71 72 //-----------/ 73 //- Methods -/ 74 //-----------/ 75 76 /** 77 * Get the description of this build job. 78 * 79 * @return String 80 */ 81 public String getDescription() 82 { 83 return this.description; 84 } //-- String getDescription() 85 86 /** 87 * Get any failure message(s) in case this build job failed. 88 * 89 * @return String 90 */ 91 public String getFailureMessage() 92 { 93 return this.failureMessage; 94 } //-- String getFailureMessage() 95 96 /** 97 * Get the modelEncoding field. 98 * 99 * @return String 100 */ 101 public String getModelEncoding() 102 { 103 return this.modelEncoding; 104 } //-- String getModelEncoding() 105 106 /** 107 * Get the name of this build job. 108 * 109 * @return String 110 */ 111 public String getName() 112 { 113 return this.name; 114 } //-- String getName() 115 116 /** 117 * Get the path to the project to build. This path is usually 118 * relative and can denote both a POM file or a project 119 * directory. 120 * 121 * @return String 122 */ 123 public String getProject() 124 { 125 return this.project; 126 } //-- String getProject() 127 128 /** 129 * Get the result of this build job. 130 * 131 * @return String 132 */ 133 public String getResult() 134 { 135 return this.result; 136 } //-- String getResult() 137 138 /** 139 * Get the number of seconds that this build job took to 140 * complete. 141 * 142 * @return double 143 */ 144 public double getTime() 145 { 146 return this.time; 147 } //-- double getTime() 148 149 /** 150 * Get the type of the build job. 151 * 152 * @return String 153 */ 154 public String getType() 155 { 156 return this.type; 157 } //-- String getType() 158 159 /** 160 * Set the description of this build job. 161 * 162 * @param description 163 */ 164 public void setDescription( String description ) 165 { 166 this.description = description; 167 } //-- void setDescription( String ) 168 169 /** 170 * Set any failure message(s) in case this build job failed. 171 * 172 * @param failureMessage 173 */ 174 public void setFailureMessage( String failureMessage ) 175 { 176 this.failureMessage = failureMessage; 177 } //-- void setFailureMessage( String ) 178 179 /** 180 * Set the modelEncoding field. 181 * 182 * @param modelEncoding 183 */ 184 public void setModelEncoding( String modelEncoding ) 185 { 186 this.modelEncoding = modelEncoding; 187 } //-- void setModelEncoding( String ) 188 189 /** 190 * Set the name of this build job. 191 * 192 * @param name 193 */ 194 public void setName( String name ) 195 { 196 this.name = name; 197 } //-- void setName( String ) 198 199 /** 200 * Set the path to the project to build. This path is usually 201 * relative and can denote both a POM file or a project 202 * directory. 203 * 204 * @param project 205 */ 206 public void setProject( String project ) 207 { 208 this.project = project; 209 } //-- void setProject( String ) 210 211 /** 212 * Set the result of this build job. 213 * 214 * @param result 215 */ 216 public void setResult( String result ) 217 { 218 this.result = result; 219 } //-- void setResult( String ) 220 221 /** 222 * Set the number of seconds that this build job took to 223 * complete. 224 * 225 * @param time 226 */ 227 public void setTime( double time ) 228 { 229 this.time = time; 230 } //-- void setTime( double ) 231 232 /** 233 * Set the type of the build job. 234 * 235 * @param type 236 */ 237 public void setType( String type ) 238 { 239 this.type = type; 240 } //-- void setType( String ) 241 242 243 /** 244 * Creates a new empty build job. 245 */ 246 public BuildJob() 247 { 248 // enables no-arg construction 249 } 250 251 /** 252 * Creates a new build job with the specified project path and type. 253 * 254 * @param project The path to the project. 255 * @param type The type of the build job. 256 */ 257 public BuildJob( String project, String type ) 258 { 259 this.project = project; 260 this.type = type; 261 } 262 263 264 /** 265 * The various results with which a build job can complete. 266 */ 267 public static class Result 268 { 269 270 /** 271 * The result value corresponding with a successful invocation of Maven and completion of all post-hook scripts. 272 */ 273 public static final String SUCCESS = "success"; 274 275 /** 276 * The result value corresponding with an invocation that failed before Maven was be invoked. 277 */ 278 public static final String FAILURE_PRE_HOOK = "failure-pre-hook"; 279 280 /** 281 * The result value corresponding with an invocation that failed while invoking of Maven. 282 */ 283 public static final String FAILURE_BUILD = "failure-build"; 284 285 /** 286 * The result value corresponding with an invocation that failed after the invocation of Maven. 287 */ 288 public static final String FAILURE_POST_HOOK = "failure-post-hook"; 289 290 /** 291 * The result value corresponding with an invocation that was skipped. 292 */ 293 public static final String SKIPPED = "skipped"; 294 295 /** 296 * The result value corresponding with an unexpected error trying to invoke Maven. 297 */ 298 public static final String ERROR = "error"; 299 300 } 301 302 303 /** 304 * The various types of a build job. 305 */ 306 public static class Type 307 { 308 309 /** 310 * A build job that should be invoked before any non-setup build jobs. 311 */ 312 public static final String SETUP = "setup"; 313 314 /** 315 * A normal build job. 316 */ 317 public static final String NORMAL = "normal"; 318 319 /** 320 * A build job that was directly selected via the <code>-Dinvoker.test=xxx,yyy</code> parameter. 321 */ 322 public static final String DIRECT = "direct"; 323 324 } 325 326 327 public String toString() 328 { 329 StringBuffer buf = new StringBuffer( 128 ); 330 buf.append( "BuildJob[project = \"" ); 331 buf.append( project ); 332 buf.append( "\", type = " ); 333 buf.append( type ); 334 buf.append( ']' ); 335 return buf.toString(); 336 } 337 338 }