1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package br.com.ingenieux.mojo.beanstalk.version;
18
19 import com.amazonaws.services.elasticbeanstalk.model.DeleteApplicationVersionRequest;
20
21 import org.apache.maven.plugin.MojoExecutionException;
22 import org.apache.maven.plugin.MojoFailureException;
23 import org.apache.maven.plugins.annotations.Mojo;
24 import org.apache.maven.plugins.annotations.Parameter;
25
26 import br.com.ingenieux.mojo.beanstalk.AbstractBeanstalkMojo;
27
28
29
30
31
32
33
34
35
36
37 @Mojo(name = "delete-application-version")
38 public class DeleteApplicationVersionMojo extends AbstractBeanstalkMojo {
39
40
41
42
43 @Parameter(property = "beanstalk.applicationName", defaultValue = "${project.artifactId}", required = true)
44 protected String applicationName;
45
46 @Parameter(property = "beanstalk.versionLabel", defaultValue = "${project.version}")
47 String versionLabel;
48
49
50
51
52 @Parameter(property = "beanstalk.deleteSourceBundle", defaultValue = "false")
53 private boolean deleteSourceBundle;
54
55 @Override
56 protected Object executeInternal() throws MojoExecutionException, MojoFailureException {
57 DeleteApplicationVersionRequest req = new DeleteApplicationVersionRequest();
58
59 req.setApplicationName(applicationName);
60 req.setDeleteSourceBundle(deleteSourceBundle);
61 req.setVersionLabel(versionLabel);
62
63 getService().deleteApplicationVersion(req);
64
65 return null;
66 }
67 }