geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: rev 57462 - geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment
Date Thu, 11 Nov 2004 19:52:56 GMT
Author: jboynes
Date: Thu Nov 11 11:52:55 2004
New Revision: 57462

Modified:
   geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
Log:
gross hack to make redeployment useful on windows

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
(original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
Thu Nov 11 11:52:55 2004
@@ -57,7 +57,31 @@
     }
 
     public List deploy(File moduleFile, File planFile) throws DeploymentException {
-        return deploy(planFile, moduleFile, null, true, null, null);
+        File tmpDir = null;
+        if (moduleFile != null && !moduleFile.isDirectory()) {
+            // todo jar url handling with Sun's VM on Windows leaves a lock on the module
file preventing rebuilds
+            // to address this we use a gross hack and copy the file to a temporary directory
+            // unfortunately the lock on the file will prevent that being deleted properly
+            // we need to rewrite deployment so that it does not use jar: urls
+            try {
+                tmpDir = File.createTempFile("deployer", ".tmpdir");
+                tmpDir.delete();
+                tmpDir.mkdir();
+                File tmpFile = new File(tmpDir, moduleFile.getName());
+                DeploymentUtil.copyFile(moduleFile, tmpFile);
+                moduleFile = tmpFile;
+            } catch (IOException e) {
+                throw new DeploymentException(e);
+            }
+        }
+
+        try {
+            return deploy(planFile, moduleFile, null, true, null, null);
+        } finally {
+            if (tmpDir != null) {
+                DeploymentUtil.recursiveDelete(tmpDir);
+            }
+        }
     }
 
     /**

Mime
View raw message