1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.scm.plugin;
20
21 import java.io.IOException;
22
23 import org.apache.maven.plugin.MojoExecutionException;
24 import org.apache.maven.plugins.annotations.Mojo;
25 import org.apache.maven.plugins.annotations.Parameter;
26 import org.apache.maven.scm.ScmException;
27 import org.apache.maven.scm.command.checkin.CheckInScmResult;
28 import org.apache.maven.scm.repository.ScmRepository;
29
30
31
32
33
34
35 @Mojo(name = "checkin", aggregator = true)
36 public class CheckinMojo extends AbstractScmMojo {
37
38
39
40 @Parameter(property = "message")
41 private String message;
42
43
44
45
46 @Parameter(property = "connectionType", defaultValue = "developerConnection")
47 private String connectionType;
48
49
50
51
52 @Parameter(property = "scmVersionType")
53 private String scmVersionType;
54
55
56
57
58 @Parameter(property = "scmVersion")
59 private String scmVersion;
60
61
62 public void execute() throws MojoExecutionException {
63 super.execute();
64
65 setConnectionType(connectionType);
66
67 try {
68 ScmRepository repository = getScmRepository();
69
70 CheckInScmResult result = getScmManager()
71 .checkIn(repository, getFileSet(), getScmVersion(scmVersionType, scmVersion), message);
72
73 checkResult(result);
74 } catch (IOException | ScmException e) {
75 throw new MojoExecutionException("Cannot run checkin command : ", e);
76 }
77 }
78 }