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