Author: ate
Date: Tue Mar 9 10:19:44 2010
New Revision: 920771
URL: http://svn.apache.org/viewvc?rev=920771&view=rev
Log:
Add Edit.required configuration option (default: true) to allow ignoring
missing target file to edit and log a warning instead of throwing an exception.
Modified:
portals/jetspeed-2/portal/trunk/maven/jetspeed-deploy-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/DeployMojo.java
Modified:
portals/jetspeed-2/portal/trunk/maven/jetspeed-deploy-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/DeployMojo.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/jetspeed-deploy-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/DeployMojo.java?rev=920771&r1=920770&r2=920771&view=diff
==============================================================================
---
portals/jetspeed-2/portal/trunk/maven/jetspeed-deploy-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/DeployMojo.java
(original)
+++
portals/jetspeed-2/portal/trunk/maven/jetspeed-deploy-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/DeployMojo.java
Tue Mar 9 10:19:44 2010
@@ -113,6 +113,7 @@ public class DeployMojo extends Abstract
private String destination;
private String targetName;
private String editorClassName;
+ private boolean required = true;
}
/**
@@ -565,7 +566,16 @@ public class DeployMojo extends Abstract
File editTargetFile = new File(targetDir, edit.targetName);
if (!editTargetFile.isFile() || !editTargetFile.canRead() ||
!editTargetFile.canWrite())
{
- throw new MojoExecutionException("Cannot find, read, or
write target file to edit: "+editTargetFile);
+ String msg = "Cannot find, read, or write target file to
edit: "+editTargetFile;
+ if (edit.required)
+ {
+ throw new MojoExecutionException(msg);
+ }
+ else
+ {
+ getLog().warn(msg);
+ continue;
+ }
}
// instantiate editor and invoke editor to edit target file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]