Author: ssmiweve
Date: 2008-01-17 10:31:15 +0100 (Thu, 17 Jan 2008)
New Revision: 5976
Modified:
trunk/mojo/src/main/java/no/sesat/mojo/DeploySesatWarfilesMojo.java
Log:
ability to override the ensureNoLocalModifications check
Modified: trunk/mojo/src/main/java/no/sesat/mojo/DeploySesatWarfilesMojo.java
===================================================================
--- trunk/mojo/src/main/java/no/sesat/mojo/DeploySesatWarfilesMojo.java
2008-01-16 20:55:24 UTC (rev 5975)
+++ trunk/mojo/src/main/java/no/sesat/mojo/DeploySesatWarfilesMojo.java
2008-01-17 09:31:15 UTC (rev 5976)
@@ -505,25 +505,32 @@
private boolean ensureNoLocalModifications() throws
ComponentLookupException, ScmException, MojoExecutionException{
- final ScmManager scmManager = (ScmManager)
container.lookup(ScmManager.ROLE);
+ if(!Boolean.getBoolean("sesat.mojo.localModifications.ignore")){
+
+ final ScmManager scmManager = (ScmManager)
container.lookup(ScmManager.ROLE);
- loadPomProject();
+ loadPomProject();
- final StatusScmResult result = scmManager.status(
-
scmManager.makeScmRepository(project.getScm().getDeveloperConnection()),
- new ScmFileSet(pomProject.getBasedir()));
+ final StatusScmResult result = scmManager.status(
+
scmManager.makeScmRepository(project.getScm().getDeveloperConnection()),
+ new ScmFileSet(pomProject.getBasedir()));
-
- if(!result.isSuccess()){
- getLog().error(result.getCommandOutput());
- throw new MojoExecutionException("Failed to ensure checkout has no
modifications");
+
+ if(!result.isSuccess()){
+
+ getLog().error(result.getCommandOutput());
+ throw new MojoExecutionException("Failed to ensure checkout
has no modifications");
+ }
+
+ if(0 < result.getChangedFiles().size()){
+
+ throw new MojoExecutionException("Your checkout has local
modifications. "
+ + "Server deploy can *only* be done with a clean
workbench.");
+ }
+
+ return result.isSuccess() && 0 == result.getChangedFiles().size();
}
- if(0 < result.getChangedFiles().size()){
- throw new MojoExecutionException("Your checkout has local
modifications. "
- + "Server deploy can *only* be done with a clean
workbench.");
- }
-
- return result.isSuccess() && 0 == result.getChangedFiles().size();
+ return true; // sesat.mojo.localModifications.ignore
}
private void updateVersionFile(final Wagon wagon)
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits