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.plugins.annotations.Mojo;
24 import org.apache.maven.plugins.annotations.Parameter;
25 import org.apache.maven.scm.ScmException;
26 import org.apache.maven.scm.command.remove.RemoveScmResult;
27 import org.apache.maven.scm.repository.ScmRepository;
28
29 import java.io.IOException;
30
31
32
33
34
35
36 @Mojo( name = "remove", aggregator = true )
37 public class RemoveMojo
38 extends AbstractScmMojo
39 {
40
41
42
43
44 @Parameter( property = "message" )
45 private String message;
46
47
48
49
50 public void execute()
51 throws MojoExecutionException
52 {
53 super.execute();
54 try
55 {
56 ScmRepository repository = getScmRepository();
57 RemoveScmResult result = getScmManager().remove( repository, getFileSet(), message );
58 checkResult( result );
59 }
60 catch ( IOException e )
61 {
62 throw new MojoExecutionException( "Cannot run remove command : " + e.getMessage(), e );
63 }
64 catch ( ScmException e )
65 {
66 throw new MojoExecutionException( "Cannot run remove command : " + e.getMessage(), e );
67 }
68 }
69 }