]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoUtils.java
Deal with already existing MANIFEST
[gpl/argeo-slc.git] / runtime / org.argeo.slc.repo / src / main / java / org / argeo / slc / repo / RepoUtils.java
index da4c35a99eb562a871812d8c009a5d2ccebe8296..ec3d17e41e580dd8d3fe27013efa085312225452 100644 (file)
@@ -200,10 +200,13 @@ public class RepoUtils implements ArgeoNames, SlcNames {
                        jarOut = new JarOutputStream(out, manifest);
                        JarEntry jarEntry = null;
                        while ((jarEntry = jarIn.getNextJarEntry()) != null) {
-                               jarOut.putNextEntry(jarEntry);
-                               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 "