1919 * under the License.
2020 */
2121
22- import java .io .File ;
22+ import java .io .IOException ;
2323
2424import org .apache .maven .plugin .MojoExecutionException ;
2525import org .apache .maven .plugins .annotations .Mojo ;
2626import org .apache .maven .plugins .annotations .Parameter ;
2727import org .apache .maven .scm .ScmException ;
28- import org .apache .maven .scm .ScmFileSet ;
2928import org .apache .maven .scm .command .status .StatusScmResult ;
3029import org .apache .maven .scm .repository .ScmRepository ;
3130
@@ -45,19 +44,13 @@ public class CheckLocalModificationsMojo
4544 */
4645 @ Parameter ( property = "scm.checkLocalModification.errorMessage" ,
4746 defaultValue = "The build will stop as there is local modifications" )
48- private String errorMessage ;
49-
47+ private String errorMessage ;
48+
5049 /**
5150 * Skip the check for local modifications if set to {@code true}.
52- */
51+ */
5352 @ Parameter ( property = "scm.checkLocalModification.skip" , defaultValue = "false" )
5453 private boolean skip ;
55-
56- /**
57- * current directory
58- */
59- @ Parameter ( defaultValue = "${basedir}" , readonly = true )
60- private File baseDirectory ;
6154
6255 public void execute ()
6356 throws MojoExecutionException
@@ -74,9 +67,9 @@ public void execute()
7467 try
7568 {
7669 ScmRepository repository = getScmRepository ();
77- result = getScmManager ().status ( repository , new ScmFileSet ( baseDirectory ) );
70+ result = getScmManager ().status ( repository , getFileSet ( ) );
7871 }
79- catch ( ScmException e )
72+ catch ( IOException | ScmException e )
8073 {
8174 throw new MojoExecutionException ( e .getMessage (), e );
8275 }
@@ -94,5 +87,5 @@ public void execute()
9487 }
9588
9689 }
97-
90+
9891}
0 commit comments