Deal with already existing MANIFEST
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 2 Jan 2015 21:09:57 +0000 (21:09 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 2 Jan 2015 21:09:57 +0000 (21:09 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@7614 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoUtils.java

index 9ff8f15fb9fb006a332c183382995da7af9d6d8a..ec3d17e41e580dd8d3fe27013efa085312225452 100644 (file)
@@ -200,11 +200,13 @@ public class RepoUtils implements ArgeoNames, SlcNames {
                        jarOut = new JarOutputStream(out, manifest);
                        JarEntry jarEntry = null;
                        while ((jarEntry = jarIn.getNextJarEntry()) != null) {
-                               JarEntry newJarEntry = new JarEntry(jarEntry.getName());
-                               jarOut.putNextEntry(newJarEntry);
-                               IOUtils.copy(jarIn, jarOut);
-                               jarIn.closeEntry();
-                               jarOut.closeEntry();
+                               if (!jarEntry.getName().equals("META-INF/MANIFEST.MF")) {
+                                       JarEntry newJarEntry = new JarEntry(jarEntry.getName());
+                                       jarOut.putNextEntry(newJarEntry);
+                                       IOUtils.copy(jarIn, jarOut);
+                                       jarIn.closeEntry();
+                                       jarOut.closeEntry();
+                               }
                        }
                } catch (IOException e) {
                        throw new SlcException("Could not copy jar with MANIFEST "