You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/05/22 08:15:36 UTC
[maven-scm] branch maven-scm-1.x updated: [SCM-943] scm:check-local-modification does not support excludes
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch maven-scm-1.x
in repository https://gitbox.apache.org/repos/asf/maven-scm.git
The following commit(s) were added to refs/heads/maven-scm-1.x by this push:
new d7107dac4 [SCM-943] scm:check-local-modification does not support excludes
d7107dac4 is described below
commit d7107dac448fa0117c35726e5ea52260340f3574
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Thu May 19 22:03:55 2022 +0200
[SCM-943] scm:check-local-modification does not support excludes
---
.../scm/plugin/CheckLocalModificationsMojo.java | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckLocalModificationsMojo.java b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckLocalModificationsMojo.java
index df106c6e0..c48569d0c 100644
--- a/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckLocalModificationsMojo.java
+++ b/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckLocalModificationsMojo.java
@@ -19,13 +19,12 @@ package org.apache.maven.scm.plugin;
* under the License.
*/
-import java.io.File;
+import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.scm.ScmException;
-import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.command.status.StatusScmResult;
import org.apache.maven.scm.repository.ScmRepository;
@@ -45,19 +44,13 @@ public class CheckLocalModificationsMojo
*/
@Parameter( property = "scm.checkLocalModification.errorMessage",
defaultValue = "The build will stop as there is local modifications" )
- private String errorMessage;
-
+ private String errorMessage;
+
/**
* Skip the check for local modifications if set to {@code true}.
- */
+ */
@Parameter( property = "scm.checkLocalModification.skip", defaultValue = "false" )
private boolean skip;
-
- /**
- * current directory
- */
- @Parameter( defaultValue = "${basedir}", readonly = true )
- private File baseDirectory;
public void execute()
throws MojoExecutionException
@@ -74,9 +67,9 @@ public class CheckLocalModificationsMojo
try
{
ScmRepository repository = getScmRepository();
- result = getScmManager().status( repository, new ScmFileSet( baseDirectory ) );
+ result = getScmManager().status( repository, getFileSet() );
}
- catch ( ScmException e )
+ catch ( IOException | ScmException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
@@ -94,5 +87,5 @@ public class CheckLocalModificationsMojo
}
}
-
+
}