You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by tm...@apache.org on 2022/09/21 11:13:21 UTC

[sling-org-apache-sling-distribution-journal] branch SLING-11560 created (now 4cf55ce)

This is an automated email from the ASF dual-hosted git repository.

tmaret pushed a change to branch SLING-11560
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal.git


      at 4cf55ce  SLING-11560 - Vault error when importing a node with the same name and UUID as a pre-existing non-sibling node

This branch includes the following new commits:

     new 4cf55ce  SLING-11560 - Vault error when importing a node with the same name and UUID as a pre-existing non-sibling node

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-org-apache-sling-distribution-journal] 01/01: SLING-11560 - Vault error when importing a node with the same name and UUID as a pre-existing non-sibling node

Posted by tm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tmaret pushed a commit to branch SLING-11560
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal.git

commit 4cf55cea4eb7c57c460c85d3b6d1f05f92900fb4
Author: tmaret <tm...@adobe.com>
AuthorDate: Wed Sep 21 13:12:55 2022 +0200

    SLING-11560 - Vault error when importing a node with the same name and UUID as a pre-existing non-sibling node
---
 pom.xml                                                              | 5 +++++
 .../distribution/journal/bookkeeper/ContentPackageExtractor.java     | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/pom.xml b/pom.xml
index 528c16d..830d984 100644
--- a/pom.xml
+++ b/pom.xml
@@ -192,6 +192,11 @@
             <artifactId>jackrabbit-jcr-commons</artifactId>
             <version>2.16.0</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit.vault</groupId>
+            <artifactId>org.apache.jackrabbit.vault</artifactId>
+            <version>3.6.4</version>
+        </dependency>
 
         <dependency>
             <groupId>com.google.code.findbugs</groupId>
diff --git a/src/main/java/org/apache/sling/distribution/journal/bookkeeper/ContentPackageExtractor.java b/src/main/java/org/apache/sling/distribution/journal/bookkeeper/ContentPackageExtractor.java
index 90ead6d..a9690b9 100644
--- a/src/main/java/org/apache/sling/distribution/journal/bookkeeper/ContentPackageExtractor.java
+++ b/src/main/java/org/apache/sling/distribution/journal/bookkeeper/ContentPackageExtractor.java
@@ -20,6 +20,7 @@ package org.apache.sling.distribution.journal.bookkeeper;
 
 import static java.lang.String.format;
 import static java.util.Objects.requireNonNull;
+import static org.apache.jackrabbit.vault.fs.api.IdConflictPolicy.LEGACY;
 
 import java.io.IOException;
 import java.util.List;
@@ -112,6 +113,8 @@ class ContentPackageExtractor {
 
     private void installPackage(JcrPackage pack, ErrorListener listener) throws RepositoryException, PackageException, IOException {
         ImportOptions opts = new ImportOptions();
+        opts.setIdConflictPolicy(LEGACY);
+        opts.setOverwritePrimaryTypesOfFolders(true);
         opts.setListener(listener);
         opts.setStrict(true);
         if (packageHandling == PackageHandling.Extract) {