19
19
* under the License.
20
20
*/
21
21
22
- import java .io .File ;
22
+ import java .io .IOException ;
23
23
24
24
import org .apache .maven .plugin .MojoExecutionException ;
25
25
import org .apache .maven .plugins .annotations .Mojo ;
26
26
import org .apache .maven .plugins .annotations .Parameter ;
27
27
import org .apache .maven .scm .ScmException ;
28
- import org .apache .maven .scm .ScmFileSet ;
29
28
import org .apache .maven .scm .command .status .StatusScmResult ;
30
29
import org .apache .maven .scm .repository .ScmRepository ;
31
30
@@ -45,19 +44,13 @@ public class CheckLocalModificationsMojo
45
44
*/
46
45
@ Parameter ( property = "scm.checkLocalModification.errorMessage" ,
47
46
defaultValue = "The build will stop as there is local modifications" )
48
- private String errorMessage ;
49
-
47
+ private String errorMessage ;
48
+
50
49
/**
51
50
* Skip the check for local modifications if set to {@code true}.
52
- */
51
+ */
53
52
@ Parameter ( property = "scm.checkLocalModification.skip" , defaultValue = "false" )
54
53
private boolean skip ;
55
-
56
- /**
57
- * current directory
58
- */
59
- @ Parameter ( defaultValue = "${basedir}" , readonly = true )
60
- private File baseDirectory ;
61
54
62
55
public void execute ()
63
56
throws MojoExecutionException
@@ -74,9 +67,9 @@ public void execute()
74
67
try
75
68
{
76
69
ScmRepository repository = getScmRepository ();
77
- result = getScmManager ().status ( repository , new ScmFileSet ( baseDirectory ) );
70
+ result = getScmManager ().status ( repository , getFileSet ( ) );
78
71
}
79
- catch ( ScmException e )
72
+ catch ( IOException | ScmException e )
80
73
{
81
74
throw new MojoExecutionException ( e .getMessage (), e );
82
75
}
@@ -94,5 +87,5 @@ public void execute()
94
87
}
95
88
96
89
}
97
-
90
+
98
91
}
0 commit comments