You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jb...@apache.org on 2004/11/11 20:52:56 UTC
svn commit: rev 57462 - geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment
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);
+ }
+ }
}
/**