Skip to content

Commit

Permalink
[SCM-943] scm:check-local-modification does not support excludes
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed May 22, 2022
1 parent bf86295 commit d7107da
Showing 1 changed file with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
* 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;

Expand All @@ -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
Expand All @@ -74,9 +67,9 @@ public void execute()
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 );
}
Expand All @@ -94,5 +87,5 @@ public void execute()
}

}

}

0 comments on commit d7107da

Please sign in to comment.