geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r264670 - in /geronimo/trunk/modules: deployment/src/java/org/apache/geronimo/deployment/Deployer.java system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
Date Tue, 30 Aug 2005 02:15:50 GMT
Author: jboynes
Date: Mon Aug 29 19:15:43 2005
New Revision: 264670

URL: http://svn.apache.org/viewcvs?rev=264670&view=rev
Log:
deployer should not attempt to write manifest twice

Modified:
    geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
    geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java?rev=264670&r1=264669&r2=264670&view=diff
==============================================================================
--- 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
Mon Aug 29 19:15:43 2005
@@ -166,17 +166,22 @@
             metaInf.mkdirs();
 
             // create the manifest
-            Manifest manifest = new Manifest();
-            Attributes mainAttributes = manifest.getMainAttributes();
-            mainAttributes.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0");
+            Manifest manifest;
             if (mainClass != null) {
-                mainAttributes.putValue(Attributes.Name.MAIN_CLASS.toString(), mainClass);
-            }
-            if (classPath != null) {
-                mainAttributes.putValue(Attributes.Name.CLASS_PATH.toString(), classPath);
-            }
-            if (endorsedDirs != null) {
-                mainAttributes.putValue(CommandLineManifest.ENDORSED_DIRS.toString(), endorsedDirs);
+                manifest = new Manifest();
+                Attributes mainAttributes = manifest.getMainAttributes();
+                mainAttributes.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0");
+                if (mainClass != null) {
+                    mainAttributes.putValue(Attributes.Name.MAIN_CLASS.toString(), mainClass);
+                }
+                if (classPath != null) {
+                    mainAttributes.putValue(Attributes.Name.CLASS_PATH.toString(), classPath);
+                }
+                if (endorsedDirs != null) {
+                    mainAttributes.putValue(CommandLineManifest.ENDORSED_DIRS.toString(),
endorsedDirs);
+                }
+            } else {
+                manifest = null;
             }
 
             ConfigurationData configurationData = builder.buildConfiguration(plan, module,
configurationDir);

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java?rev=264670&r1=264669&r2=264670&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
(original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
Mon Aug 29 19:15:43 2005
@@ -51,12 +51,17 @@
     public static void createExecutableConfiguration(ConfigurationData configurationData,
Manifest manifest, File configurationDir, File destinationFile) throws IOException, InvalidConfigException
{
         JarOutputStream out = null;
         try {
-            out = new JarOutputStream(new FileOutputStream(destinationFile), manifest);
             byte[] buffer = new byte[4096];
 
-            // add the startup file which allows us to locate the startup directory
-            out.putNextEntry(new ZipEntry("META-INF/startup-jar"));
-            out.closeEntry();
+            if (manifest != null) {
+                out = new JarOutputStream(new FileOutputStream(destinationFile), manifest);
+
+                // add the startup file which allows us to locate the startup directory
+                out.putNextEntry(new ZipEntry("META-INF/startup-jar"));
+                out.closeEntry();
+            } else {
+                out = new JarOutputStream(new FileOutputStream(destinationFile));
+            }
 
             // write the configurationData
             ExecutableConfigurationUtil.writeConfiguration(configurationData, out);



Mime
View raw message