geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r825791 - in /geronimo/sandbox/djencks/osgi/framework: ./ buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/reporting...
Date Fri, 16 Oct 2009 07:52:02 GMT
Author: djencks
Date: Fri Oct 16 07:52:00 2009
New Revision: 825791

URL: http://svn.apache.org/viewvc?rev=825791&view=rev
Log:
GERONIMO-4902 use ant instead of copied plexus code

Removed:
    geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/plexus/
Modified:
    geronimo/sandbox/djencks/osgi/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveMojo.java
    geronimo/sandbox/djencks/osgi/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/reporting/SurefireReporter.java
    geronimo/sandbox/djencks/osgi/framework/configs/gshell-geronimo/src/main/history/dependencies.xml
    geronimo/sandbox/djencks/osgi/framework/configs/jsr88-cli/src/main/history/dependencies.xml
    geronimo/sandbox/djencks/osgi/framework/configs/jsr88-deploymentfactory/src/main/history/dependencies.xml
    geronimo/sandbox/djencks/osgi/framework/configs/online-deployer/src/main/history/dependencies.xml
    geronimo/sandbox/djencks/osgi/framework/configs/plugin/src/main/history/dependencies.xml
    geronimo/sandbox/djencks/osgi/framework/configs/shutdown/src/main/history/dependencies.xml
    geronimo/sandbox/djencks/osgi/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/GeronimoBranding.java
    geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
    geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/pom.xml
    geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ArchiverGBean.java
    geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
    geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerArchiver.java
    geronimo/sandbox/djencks/osgi/framework/pom.xml

Modified: geronimo/sandbox/djencks/osgi/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveMojo.java?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveMojo.java
(original)
+++ geronimo/sandbox/djencks/osgi/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveMojo.java
Fri Oct 16 07:52:00 2009
@@ -25,7 +25,6 @@
 
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.system.plugin.ArchiverGBean;
-import org.apache.geronimo.system.plugin.plexus.archiver.ArchiverException;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -93,7 +92,7 @@
         }
     }
 
-    private void archive(String type, ArchiverGBean archiver) throws ArchiverException, IOException
{
+    private void archive(String type, ArchiverGBean archiver) throws IOException {
         Artifact artifact1 = new Artifact(project.getArtifact().getGroupId(), project.getArtifact().getArtifactId(),
project.getArtifact().getVersion(), type);
         File target1 = archiver.archive("", destDir.getAbsolutePath(), artifact1);
         projectHelper.attachArtifact( project, artifact1.getType(), "bin", target1 );

Modified: geronimo/sandbox/djencks/osgi/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/reporting/SurefireReporter.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/reporting/SurefireReporter.java?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/reporting/SurefireReporter.java
(original)
+++ geronimo/sandbox/djencks/osgi/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/reporting/SurefireReporter.java
Fri Oct 16 07:52:00 2009
@@ -47,7 +47,6 @@
 import org.apache.maven.surefire.util.PrettyPrintXMLWriter;
 
 import org.codehaus.plexus.util.FileUtils;
-import org.apache.geronimo.system.plugin.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 import org.codehaus.plexus.util.xml.Xpp3DomWriter;
@@ -224,7 +223,7 @@
             throw new ReporterException("Unable to create file: " + e.getMessage(), e);
         }
         finally {
-            IOUtil.close(writer);
+            writer.close();
         }
     }
 

Modified: geronimo/sandbox/djencks/osgi/framework/configs/gshell-geronimo/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/configs/gshell-geronimo/src/main/history/dependencies.xml?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/configs/gshell-geronimo/src/main/history/dependencies.xml
(original)
+++ geronimo/sandbox/djencks/osgi/framework/configs/gshell-geronimo/src/main/history/dependencies.xml
Fri Oct 16 07:52:00 2009
@@ -128,6 +128,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.ant</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
         <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
         <type>jar</type>
     </dependency>

Modified: geronimo/sandbox/djencks/osgi/framework/configs/jsr88-cli/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/configs/jsr88-cli/src/main/history/dependencies.xml?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/configs/jsr88-cli/src/main/history/dependencies.xml
(original)
+++ geronimo/sandbox/djencks/osgi/framework/configs/jsr88-cli/src/main/history/dependencies.xml
Fri Oct 16 07:52:00 2009
@@ -98,6 +98,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.ant</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
         <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
         <type>jar</type>
     </dependency>

Modified: geronimo/sandbox/djencks/osgi/framework/configs/jsr88-deploymentfactory/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/configs/jsr88-deploymentfactory/src/main/history/dependencies.xml?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/configs/jsr88-deploymentfactory/src/main/history/dependencies.xml
(original)
+++ geronimo/sandbox/djencks/osgi/framework/configs/jsr88-deploymentfactory/src/main/history/dependencies.xml
Fri Oct 16 07:52:00 2009
@@ -78,6 +78,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.ant</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
         <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
         <type>jar</type>
     </dependency>

Modified: geronimo/sandbox/djencks/osgi/framework/configs/online-deployer/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/configs/online-deployer/src/main/history/dependencies.xml?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/configs/online-deployer/src/main/history/dependencies.xml
(original)
+++ geronimo/sandbox/djencks/osgi/framework/configs/online-deployer/src/main/history/dependencies.xml
Fri Oct 16 07:52:00 2009
@@ -63,6 +63,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.ant</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
         <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
         <type>jar</type>
     </dependency>

Modified: geronimo/sandbox/djencks/osgi/framework/configs/plugin/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/configs/plugin/src/main/history/dependencies.xml?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/configs/plugin/src/main/history/dependencies.xml
(original)
+++ geronimo/sandbox/djencks/osgi/framework/configs/plugin/src/main/history/dependencies.xml
Fri Oct 16 07:52:00 2009
@@ -28,6 +28,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.ant</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
         <artifactId>org.apache.servicemix.bundles.jaxb-impl</artifactId>
         <type>jar</type>
     </dependency>

Modified: geronimo/sandbox/djencks/osgi/framework/configs/shutdown/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/configs/shutdown/src/main/history/dependencies.xml?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/configs/shutdown/src/main/history/dependencies.xml
(original)
+++ geronimo/sandbox/djencks/osgi/framework/configs/shutdown/src/main/history/dependencies.xml
Fri Oct 16 07:52:00 2009
@@ -98,6 +98,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.ant</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
         <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
         <type>jar</type>
     </dependency>

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/GeronimoBranding.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/GeronimoBranding.java?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/GeronimoBranding.java
(original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/GeronimoBranding.java
Fri Oct 16 07:52:00 2009
@@ -19,25 +19,19 @@
 
 package org.apache.geronimo.commands;
 
-import java.io.File;
-import java.io.PrintWriter;
-import java.io.StringWriter;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.util.Properties;
 
-import org.apache.geronimo.gshell.ansi.Buffer;
-import org.apache.geronimo.gshell.ansi.Code;
+import jline.Terminal;
 import org.apache.geronimo.gshell.ansi.RenderWriter;
 import org.apache.geronimo.gshell.branding.Branding;
 import org.apache.geronimo.gshell.branding.BrandingSupport;
-import org.apache.geronimo.gshell.branding.VersionLoader;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.util.StringUtils;
-import org.apache.geronimo.system.plugin.plexus.util.IOUtil;
-
-import jline.Terminal;
 
 /**
  * Provides the branding for Geronimo usage of GShell.
@@ -108,7 +102,11 @@
                 throw new RuntimeException("Failed to load: " + resourceName, e);
             }
             finally {
-                IOUtil.close(input);
+                try {
+                    input.close();
+                } catch (IOException e) {
+                    //ignore
+                }
             }
         }
         

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
(original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
Fri Oct 16 07:52:00 2009
@@ -63,7 +63,7 @@
 import org.apache.geronimo.system.plugin.PluginInstaller;
 import org.apache.geronimo.system.plugin.PluginRepositoryList;
 import org.apache.geronimo.system.plugin.ServerArchiver;
-import org.apache.geronimo.system.plugin.plexus.archiver.ArchiverException;
+//import org.apache.geronimo.system.plugin.plexus.archiver.ArchiverException;
 import org.apache.geronimo.system.plugin.model.PluginListType;
 import org.apache.geronimo.system.plugin.model.PluginType;
 import org.apache.geronimo.system.plugin.model.AttributesType;
@@ -380,7 +380,8 @@
         }
     }
 
-    public File archive(String sourcePath, String destPath, Artifact artifact) throws ArchiverException,
IOException {
+    public File archive(String sourcePath, String destPath, Artifact artifact) throws //ArchiverException,
+             IOException {
         ServerArchiver archiver = getServerArchiver();
         try {
             return archiver.archive(sourcePath, destPath, artifact);

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/pom.xml?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/pom.xml (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/pom.xml Fri Oct 16 07:52:00
2009
@@ -62,6 +62,10 @@
             <groupId>org.apache.servicemix.bundles</groupId>
             <artifactId>org.apache.servicemix.bundles.woodstox</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.ant</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>org.apache.geronimo.testsupport</groupId>

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ArchiverGBean.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ArchiverGBean.java?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ArchiverGBean.java
(original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ArchiverGBean.java
Fri Oct 16 07:52:00 2009
@@ -32,14 +32,14 @@
 import org.apache.geronimo.kernel.config.IOUtil;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
-import org.apache.geronimo.system.plugin.plexus.archiver.Archiver;
-import org.apache.geronimo.system.plugin.plexus.archiver.ArchiverException;
-import org.apache.geronimo.system.plugin.plexus.archiver.UnixStat;
-import org.apache.geronimo.system.plugin.plexus.archiver.tar.TarArchiver;
-import org.apache.geronimo.system.plugin.plexus.archiver.tar.TarLongFileMode;
-import org.apache.geronimo.system.plugin.plexus.archiver.zip.ZipArchiver;
-//maven inconsistency -- if we can use 1.0-alpha-9 uncomment
-//import org.codehaus.plexus.archiver.util.DefaultFileSet;
+import org.apache.tools.ant.taskdefs.MatchingTask;
+import org.apache.tools.ant.taskdefs.Tar;
+import org.apache.tools.ant.taskdefs.Zip;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.ResourceCollection;
+import org.apache.tools.ant.types.TarFileSet;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.ZipFileSet;
 
 /**
  * @version $Rev$ $Date$
@@ -73,33 +73,53 @@
         }
     }
         
-    public File archive(String sourcePath, String destPath, Artifact artifact) throws ArchiverException,
IOException {
+    public File archive(String sourcePath, String destPath, Artifact artifact) throws //ArchiverException,
+            IOException {
         File source = serverInfo.resolve(sourcePath);
         File dest = serverInfo.resolve(destPath);
         String serverName = artifact.getArtifactId() + "-" + artifact.getVersion();
         dest = new File(dest, serverName + "-bin." + artifact.getType());
-        Archiver archiver;
+        Project project = new Project();
+        MatchingTask archiver;
         if ("tar.gz".equals(artifact.getType())) {
-            archiver = new TarArchiver();
-            TarArchiver.TarCompressionMethod tarCompressionMethod = new TarArchiver.TarCompressionMethod();
+            Tar tar = new Tar();
+            Tar.TarCompressionMethod tarCompressionMethod = new Tar.TarCompressionMethod();
             tarCompressionMethod.setValue("gzip");
-            ((TarArchiver) archiver).setCompression(tarCompressionMethod);
-            TarLongFileMode fileMode = new TarLongFileMode();
-            fileMode.setValue(TarLongFileMode.GNU);
-            ((TarArchiver) archiver).setLongfile(fileMode);
+            tar.setCompression(tarCompressionMethod);
+            Tar.TarLongFileMode fileMode = new Tar.TarLongFileMode();
+            fileMode.setValue(Tar.TarLongFileMode.GNU);
+            tar.setLongfile(fileMode);
+            tar.setDestFile(dest);
+//            tar.setBasedir(source);
+            TarFileSet rc = new TarFileSet();
+            rc.setDir(source);
+            rc.setPrefix(serverName);
+            rc.setProject(project);
+            tar.add(rc);
+            archiver = tar;
         } else if ("zip".equals(artifact.getType())) {
-            archiver = new ZipArchiver();
+            Zip zip = new Zip();
+            zip.setDestFile(dest);
+//            zip.setBasedir(source);
+            ZipFileSet fs = new ZipFileSet();
+            fs.setDir(source);
+            fs.setPrefix(serverName);
+            fs.setProject(project);
+            zip.addFileset(fs);
+            archiver = zip;
         } else {
             throw new IllegalArgumentException("Unknown target type: " + artifact.getType());
         }
-        archiver.setIncludeEmptyDirs(true);
-        archiver.setDestFile(dest);
+        archiver.setProject(project);
+//        archiver.set(true);
+//        archiver.set(dest);
+//        archiver.setIncludes("**");
 /* see if using plexus-archiver 1.0-alpha-7 same as maven lets us share code.  Following
is for 1.0-alpha-9
         DefaultFileSet all = new DefaultFileSet();
         all.setDirectory(source);
         archiver.addFileSet(all);
 */
-        
+/*
         // add in all files and mark them with default file permissions
         Map<File, Boolean> emptyDirs = new HashMap<File, Boolean>();
         Map<String, File> all = IOUtil.listAllFileNames(source);
@@ -159,8 +179,8 @@
                 }
             }
         }
-        
-        archiver.createArchive();
+*/
+        archiver.execute();
         return dest;
     }
 

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
(original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Fri Oct 16 07:52:00 2009
@@ -99,11 +99,11 @@
 import org.apache.geronimo.system.plugin.model.PluginXmlUtil;
 import org.apache.geronimo.system.plugin.model.PrerequisiteType;
 import org.apache.geronimo.system.plugin.model.PropertyType;
-import org.apache.geronimo.system.plugin.plexus.util.FileUtils;
 import org.apache.geronimo.system.repository.Maven2Repository;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.apache.geronimo.system.threads.ThreadPool;
+import org.apache.tools.ant.util.FileUtils;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -221,10 +221,10 @@
                                 final BundleContext bundleContext) throws Exception {
         final ArtifactManager artifactManager = new DefaultArtifactManager();
 
-        FileUtils.forceMkdir(new File(targetServerPath));
+        forceMkdir(new File(targetServerPath));
         serverInfo = new BasicServerInfo(targetServerPath, false, null);
         File targetRepositoryFile = serverInfo.resolve(targetRepositoryPath);
-        FileUtils.forceMkdir(targetRepositoryFile);
+        forceMkdir(targetRepositoryFile);
         writeableRepo = new Maven2Repository(targetRepositoryFile);
         configStore = new RepositoryConfigurationStore(writeableRepo);
         threadPool = null;
@@ -315,7 +315,7 @@
                                           Map<String, org.apache.geronimo.system.plugin.ServerInstance>
servers,
                                           boolean live) throws IOException {
         File targetConfigDirectory = serverInfo.resolveServer(serverInstance.getConfigFile()).getParentFile();
-        FileUtils.forceMkdir(targetConfigDirectory);
+        forceMkdir(targetConfigDirectory);
         org.apache.geronimo.system.plugin.ServerInstance instance = serverInstance.getServerInstance(artifactManager,
targetRepo, serverInfo, servers, live);
         servers.put(instance.getServerName(), instance);
     }
@@ -414,7 +414,7 @@
                 File historyFile = serverInfo.resolveServer(installedPluginsList);
                 File parentFile = historyFile.getParentFile();
                 if (!parentFile.exists()) {
-                    FileUtils.forceMkdir(parentFile);
+                    forceMkdir(parentFile);
                 }
                 OutputStream out = new FileOutputStream(historyFile);
                 try {
@@ -441,7 +441,7 @@
         DownloadResults downloadPoller = new DownloadResults();
         File targetServerPath = serverInfo.resolveServer(relativeTargetServerPath);
         if (targetServerPath.exists()) {
-            FileUtils.forceDelete(targetServerPath);
+            FileUtils.delete(targetServerPath);
         }
         String targetServerPathName = targetServerPath.getAbsolutePath();
         Kernel kernel = new BasicKernel("assembly", bundleContext);
@@ -1837,6 +1837,17 @@
         return value;
     }
 
+    private static void forceMkdir(File dir) {
+        if (dir.exists()) {
+            if (!dir.isDirectory()) {
+                throw new RuntimeException("'directory' is a file: " + dir);
+            }
+            return;
+        }
+        if (!dir.mkdirs()) {
+            throw new RuntimeException("Could not create dir: " + dir);
+        }
+    }
 
     /**
      * Helper clas to extract a name and module ID from a plugin metadata file.

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerArchiver.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerArchiver.java?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerArchiver.java
(original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerArchiver.java
Fri Oct 16 07:52:00 2009
@@ -24,11 +24,12 @@
 import java.io.IOException;
 
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.system.plugin.plexus.archiver.ArchiverException;
+//import org.apache.geronimo.system.plugin.plexus.archiver.ArchiverException;
 
 /**
  * @version $Rev$ $Date$
  */
 public interface ServerArchiver {
-    File archive(String sourcePath, String destPath, Artifact artifact) throws ArchiverException,
IOException;
+    File archive(String sourcePath, String destPath, Artifact artifact) throws //ArchiverException,
+            IOException;
 }

Modified: geronimo/sandbox/djencks/osgi/framework/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/pom.xml?rev=825791&r1=825790&r2=825791&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/pom.xml (original)
+++ geronimo/sandbox/djencks/osgi/framework/pom.xml Fri Oct 16 07:52:00 2009
@@ -220,6 +220,11 @@
 
             <dependency>
                 <groupId>org.apache.servicemix.bundles</groupId>
+                <artifactId>org.apache.servicemix.bundles.ant</artifactId>
+                <version>1.7.0_1</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.servicemix.bundles</groupId>
                 <artifactId>org.apache.servicemix.bundles.commons-jexl</artifactId>
                 <version>1.1_2-SNAPSHOT</version>
                 <exclusions>



Mime
View raw message