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

kwin pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git


The following commit(s) were added to refs/heads/master by this push:
     new 40b3bbd  SLING-10221 don't add package metadata below jcr_root (#63)
40b3bbd is described below

commit 40b3bbd5c8c0d6bf79f30af19f1e24a6d441aa96
Author: Konrad Windszus <[email protected]>
AuthorDate: Wed Mar 17 08:07:08 2021 +0100

    SLING-10221 don't add package metadata below jcr_root (#63)
---
 .../cpconverter/vltpkg/VaultPackageAssembler.java  | 10 ---
 .../sling/feature/cpconverter/vltpkg/config.xml    | 95 ----------------------
 .../cpconverter/vltpkg/definition/.content.xml     | 19 -----
 .../sling/feature/cpconverter/vltpkg/settings.xml  | 22 -----
 .../ContentPackage2FeatureModelConverterTest.java  | 28 ++-----
 5 files changed, 5 insertions(+), 169 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/feature/cpconverter/vltpkg/VaultPackageAssembler.java
 
b/src/main/java/org/apache/sling/feature/cpconverter/vltpkg/VaultPackageAssembler.java
index 81da36c..a8ea4f8 100644
--- 
a/src/main/java/org/apache/sling/feature/cpconverter/vltpkg/VaultPackageAssembler.java
+++ 
b/src/main/java/org/apache/sling/feature/cpconverter/vltpkg/VaultPackageAssembler.java
@@ -67,8 +67,6 @@ import org.slf4j.LoggerFactory;
 
 public class VaultPackageAssembler implements EntryHandler, FileFilter {
 
-    private static final String[] INCLUDE_RESOURCES = { 
PACKAGE_DEFINITION_XML, CONFIG_XML, SETTINGS_XML };
-
     private static final Pattern OSGI_BUNDLE_PATTERN = 
Pattern.compile("(jcr_root)?/apps/[^/]+/install(\\.([^/]+))?/.+\\.jar");
 
     private static final Logger log = 
LoggerFactory.getLogger(VaultPackageAssembler.class);
@@ -262,14 +260,6 @@ public class VaultPackageAssembler implements 
EntryHandler, FileFilter {
             IOUtils.copy(input, output);
         }
 
-        // copy the required resources
-
-        for (String resource : INCLUDE_RESOURCES) {
-            try (InputStream input = getClass().getResourceAsStream(resource)) 
{
-                addEntry(ROOT_DIR + '/' + resource, input);
-            }
-        }
-
         // create the target archiver
 
         Archiver archiver = new ZipArchiver();
diff --git 
a/src/main/resources/org/apache/sling/feature/cpconverter/vltpkg/config.xml 
b/src/main/resources/org/apache/sling/feature/cpconverter/vltpkg/config.xml
deleted file mode 100644
index 54a0a38..0000000
--- a/src/main/resources/org/apache/sling/feature/cpconverter/vltpkg/config.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with this
- work for additional information regarding copyright ownership. The ASF
- licenses this file to You under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- License for the specific language governing permissions and limitations under
- the License.
--->
-<vaultfs version="1.1">
-  <!--
-    Defines the content aggregation. The order of the defined aggregates
-    is important for finding the correct aggregator.
-  -->
-  <aggregates>
-    <!--
-      Defines an aggregate that handles nt:file and nt:resource nodes.
-    -->
-    <aggregate type="file" title="File Aggregate"/>
-
-    <!--
-      Defines an aggregate that handles file/folder like nodes. It matches
-      all nt:hierarchyNode nodes that have or define a jcr:content
-      child node and excludes child nodes that are nt:hierarchyNodes.
-    -->
-    <aggregate type="filefolder" title="File/Folder Aggregate"/>
-
-    <!--
-      Defines an aggregate that handles nt:nodeType nodes and serializes
-      them into .cnd notation.
-    -->
-    <aggregate type="nodetype" title="Node Type Aggregate" />
-
-    <!--
-      Defines an aggregate that defines full coverage for certain node
-      types that cannot be covered by the default aggregator.
-    -->
-    <aggregate type="full" title="Full Coverage Aggregate">
-      <matches>
-        <include nodeType="rep:AccessControl" respectSupertype="true" />
-        <include nodeType="cq:Widget" respectSupertype="true" />
-        <include nodeType="cq:WidgetCollection" respectSupertype="true" />
-        <include nodeType="cq:EditConfig" respectSupertype="true" />
-        <include nodeType="cq:WorkflowModel" respectSupertype="true" />
-        <include nodeType="vlt:FullCoverage" respectSupertype="true" />
-        <include nodeType="mix:language" respectSupertype="true" />
-        <include nodeType="sling:OsgiConfig" respectSupertype="true" />
-      </matches>
-    </aggregate>
-
-    <!--
-      Defines an aggregate that handles nt:folder like nodes.
-    -->
-    <aggregate type="generic" title="Folder Aggregate">
-      <matches>
-        <include nodeType="nt:folder" respectSupertype="true" />
-      </matches>
-      <contains>
-        <exclude isNode="true" />
-      </contains>
-    </aggregate>
-
-    <!--
-      Defines the default aggregate
-    -->
-    <aggregate type="generic" title="Default Aggregator" isDefault="true">
-      <contains>
-        <exclude nodeType="nt:hierarchyNode" respectSupertype="true" />
-      </contains>
-      <matches>
-        <!-- all -->
-      </matches>
-    </aggregate>
-
-  </aggregates>
-
-  <!--
-    defines the input handlers
-  -->
-  <handlers>
-    <handler type="folder"/>
-    <handler type="file"/>
-    <handler type="nodetype"/>
-    <handler type="generic"/>
-  </handlers>
-
-</vaultfs>
diff --git 
a/src/main/resources/org/apache/sling/feature/cpconverter/vltpkg/definition/.content.xml
 
b/src/main/resources/org/apache/sling/feature/cpconverter/vltpkg/definition/.content.xml
deleted file mode 100644
index abf67f1..0000000
--- 
a/src/main/resources/org/apache/sling/feature/cpconverter/vltpkg/definition/.content.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with this
- work for additional information regarding copyright ownership. The ASF
- licenses this file to You under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- License for the specific language governing permissions and limitations under
- the License.
--->
-<jcr:root xmlns:vlt="http://www.day.com/jcr/vault/1.0"; 
xmlns:jcr="http://www.jcp.org/jcr/1.0";
-  jcr:primaryType="vlt:PackageDefinition" />
diff --git 
a/src/main/resources/org/apache/sling/feature/cpconverter/vltpkg/settings.xml 
b/src/main/resources/org/apache/sling/feature/cpconverter/vltpkg/settings.xml
deleted file mode 100644
index 679e6b1..0000000
--- 
a/src/main/resources/org/apache/sling/feature/cpconverter/vltpkg/settings.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-<vault version="1.0">
-  <ignore name=".git" />
-  <ignore name=".svn" />
-  <ignore name=".DS_Store" />
-</vault>
\ No newline at end of file
diff --git 
a/src/test/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverterTest.java
 
b/src/test/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverterTest.java
index 801d5b0..9ea256c 100644
--- 
a/src/test/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverterTest.java
+++ 
b/src/test/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverterTest.java
@@ -195,9 +195,6 @@ public class ContentPackage2FeatureModelConverterTest {
                                 "META-INF/vault/properties.xml",
                                 "META-INF/vault/config.xml",
                                 "META-INF/vault/filter.xml",
-                                "jcr_root/settings.xml",
-                                "jcr_root/config.xml",
-                                "jcr_root/definition/.content.xml",
                                 "jcr_root/apps/.content.xml");
             verifyContentPackage(new File(outputDirectory, 
"asd/sample/Asd.Retail.ui.content/0.0.1/Asd.Retail.ui.content-0.0.1-cp2fm-converted.zip"),
                                 "META-INF/vault/settings.xml",
@@ -205,28 +202,19 @@ public class ContentPackage2FeatureModelConverterTest {
                                 "META-INF/vault/config.xml",
                                 "META-INF/vault/filter.xml",
                                 "META-INF/vault/filter-plugin-generated.xml",
-                                "jcr_root/settings.xml",
                                 "jcr_root/content/asd/.content.xml",
-                                "jcr_root/content/asd/resources.xml",
-                                "jcr_root/config.xml",
-                                "jcr_root/definition/.content.xml");
+                                "jcr_root/content/asd/resources.xml");
             verifyContentPackage(new File(outputDirectory, 
"asd/sample/asd.retail.apps/0.0.1/asd.retail.apps-0.0.1-cp2fm-converted.zip"),
                                 "META-INF/vault/settings.xml",
                                 "META-INF/vault/properties.xml",
                                 "META-INF/vault/config.xml",
                                 "META-INF/vault/filter.xml",
-                                "META-INF/vault/filter-plugin-generated.xml",
-                                "jcr_root/settings.xml",
-                                "jcr_root/config.xml",
-                                "jcr_root/definition/.content.xml");
+                                "META-INF/vault/filter-plugin-generated.xml");
             verifyContentPackage(new File(outputDirectory, 
"asd/sample/asd.retail.all/0.0.1/asd.retail.all-0.0.1-cp2fm-converted.zip"),
                                 "META-INF/vault/settings.xml",
                                 "META-INF/vault/properties.xml",
                                 "META-INF/vault/config.xml",
-                                "META-INF/vault/filter.xml",
-                                "jcr_root/settings.xml",
-                                "jcr_root/config.xml",
-                                "jcr_root/definition/.content.xml");
+                                "META-INF/vault/filter.xml");
         } finally {
             deleteDirTree(outputDirectory);
         }
@@ -323,10 +311,7 @@ public class ContentPackage2FeatureModelConverterTest {
                                 "META-INF/vault/filter.xml",
                                 "META-INF/vault/properties.xml",
                                 "jcr_root/.content.xml",
-                                "jcr_root/testroot/.content.xml",
-                                "jcr_root/settings.xml",
-                                "jcr_root/config.xml",
-                                "jcr_root/definition/.content.xml");
+                                "jcr_root/testroot/.content.xml");
             verifyPropertiesXmlEntry(expectedPackage, 
"!installhook.test1.class", "!installhook.test2.class");
         } finally {
             deleteDirTree(outputDirectory);
@@ -354,10 +339,7 @@ public class ContentPackage2FeatureModelConverterTest {
                     "META-INF/vault/hooks/vault-hook-example-3.0.0.jar",
                     "META-INF/vault/properties.xml",
                     "jcr_root/.content.xml",
-                    "jcr_root/testroot/.content.xml",
-                    "jcr_root/settings.xml",
-                    "jcr_root/config.xml",
-                    "jcr_root/definition/.content.xml");
+                    "jcr_root/testroot/.content.xml");
             verifyPropertiesXmlEntry(expectedPackage, 
"installhook.test1.class", "installhook.test2.class");
         } finally {
             deleteDirTree(outputDirectory);

Reply via email to