You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gi...@apache.org on 2006/10/19 17:29:06 UTC

svn commit: r465661 - /cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/monolithic/MonolithicCocoonDeployer.java

Author: giacomo
Date: Thu Oct 19 08:29:05 2006
New Revision: 465661

URL: http://svn.apache.org/viewvc?view=rev&rev=465661
Log:
copy over properties from current development block to the assembled webapp

Modified:
    cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/monolithic/MonolithicCocoonDeployer.java

Modified: cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/monolithic/MonolithicCocoonDeployer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/monolithic/MonolithicCocoonDeployer.java?view=diff&rev=465661&r1=465660&r2=465661
==============================================================================
--- cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/monolithic/MonolithicCocoonDeployer.java (original)
+++ cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/monolithic/MonolithicCocoonDeployer.java Thu Oct 19 08:29:05 2006
@@ -26,6 +26,7 @@
 import java.io.OutputStream;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.net.URL;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -36,6 +37,7 @@
 import org.apache.cocoon.maven.deployer.utils.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
 
 /**
  * Deploy blocks to a monolithic Cocoon web application. The files contained by
@@ -61,6 +63,7 @@
             final DevelopmentBlock[] developmentBlocks, DevelopmentProperty[] developmentProperties)
             throws DeploymentException {
 
+        
         xwebPatcher.setLogger( logger );
         // iterate over all blocks that need to be installed into a J2EE web
         // application
@@ -138,6 +141,23 @@
                             throw new DeploymentException("Can't process patch file '" + currentFile.getAbsolutePath()
                                     + "'.", e);
                         }
+                    }
+                }
+                if( currentBlock.propsPath != null ) {
+                    URI uri = null;
+                    try {
+                        uri = new URI(currentBlock.propsPath);
+                    } catch (URISyntaxException e) {
+                        throw new RuntimeException("should not happen", e);
+                    }
+
+                    final File sourceDir = new File(uri);
+                    final File destDir = new File(basedir, "WEB-INF/cocoon/properties");
+                    this.logger.info( "Copying properties from '" + sourceDir.getPath() + "' ('"+currentBlock.propsPath+"') to '" + destDir.getPath() + "'" );
+                    try {
+                        org.apache.commons.io.FileUtils.copyDirectory( sourceDir, destDir);
+                    } catch (IOException e) {
+                        throw new DeploymentException("Cannot copy properties from '" + sourceDir.getPath() + "'", e);
                     }
                 }
             }