| 1 |
|
package org.apache.maven.scm.plugin; |
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
|
| 22 |
|
import org.apache.maven.plugin.MojoExecutionException; |
| 23 |
|
import org.apache.maven.scm.ScmException; |
| 24 |
|
import org.apache.maven.scm.ScmFile; |
| 25 |
|
import org.apache.maven.scm.command.checkin.CheckInScmResult; |
| 26 |
|
import org.apache.maven.scm.repository.ScmRepository; |
| 27 |
|
|
| 28 |
|
import java.io.IOException; |
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
@author |
| 34 |
|
@version |
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 3 |
Complexity Density: 0.3 |
|
| 38 |
|
public class CheckinMojo extends AbstractScmMojo { |
| 39 |
|
|
| 40 |
|
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
|
private String message; |
| 45 |
|
|
| 46 |
|
|
| 47 |
|
|
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
private String connectionType; |
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
| 55 |
|
|
| 56 |
|
|
| 57 |
|
|
| 58 |
|
private String scmVersionType; |
| 59 |
|
|
| 60 |
|
|
| 61 |
|
|
| 62 |
|
|
| 63 |
|
|
| 64 |
|
|
| 65 |
|
private String scmVersion; |
| 66 |
|
|
| 67 |
|
@inheritDoc |
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 3 |
Complexity Density: 0.3 |
|
| 68 |
0
|
public void execute() throws MojoExecutionException {... |
| 69 |
0
|
super.execute(); |
| 70 |
|
|
| 71 |
0
|
setConnectionType(connectionType); |
| 72 |
|
|
| 73 |
0
|
try { |
| 74 |
0
|
ScmRepository repository = getScmRepository(); |
| 75 |
|
|
| 76 |
0
|
CheckInScmResult result = getScmManager().checkIn(repository, getFileSet(), |
| 77 |
|
getScmVersion(scmVersionType, scmVersion), message); |
| 78 |
|
|
| 79 |
0
|
checkResult(result); |
| 80 |
|
|
| 81 |
0
|
for (ScmFile checkedInFile : result.getCheckedInFiles()) { |
| 82 |
0
|
getLog().info("Checked in " + checkedInFile.getPath()); |
| 83 |
|
} |
| 84 |
|
} catch (IOException e) { |
| 85 |
0
|
throw new MojoExecutionException("Cannot run checkin command : ", e); |
| 86 |
|
} catch (ScmException e) { |
| 87 |
0
|
throw new MojoExecutionException("Cannot run checkin command : ", e); |
| 88 |
|
} |
| 89 |
|
} |
| 90 |
|
} |