View Javadoc

1   package org.kuali.maven.mojo;
2   
3   import java.util.List;
4   
5   import org.apache.maven.plugin.MojoExecutionException;
6   import org.kuali.maven.common.PropertiesUtils;
7   import org.kuali.maven.mojo.context.MojoContext;
8   
9   /**
10   * Connect to a Jenkins server and update one or more existing jobs configuration
11   * 
12   * @goal updatejobs
13   * @requiresDependencyResolution test
14   */
15  public class UpdateJobsMojo extends AbstractJobConfigMojo {
16  
17  	/**
18  	 * The command issued to Jenkins CLI
19  	 * 
20  	 * @parameter expression="${jenkins.cmd}" default-value="update-job"
21  	 * @required
22  	 */
23  	private String cmd;
24  
25  	/**
26  	 * Comma delimited list of types of jobs to update
27  	 * 
28  	 * @parameter expression="${jenkins.types}" default-value="publish,unit,license,release"
29  	 * @required
30  	 */
31  	private String types;
32  
33  	@Override
34  	public void execute() throws MojoExecutionException {
35  		setStopOnError(false);
36  		String[] tokens = PropertiesUtils.splitAndTrim(types, ",");
37  		List<MojoContext> contexts = helper.pushJobsToJenkins(this, tokens);
38  		helper.handleResults(contexts);
39  	}
40  
41  	public String getCmd() {
42  		return cmd;
43  	}
44  
45  	public void setCmd(String cmd) {
46  		this.cmd = cmd;
47  	}
48  
49  	public String getTypes() {
50  		return types;
51  	}
52  
53  	public void setTypes(String types) {
54  		this.types = types;
55  	}
56  
57  }