remove unrelated changes
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 d359045..81da36c 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
@@ -18,7 +18,10 @@
import static org.apache.jackrabbit.vault.util.Constants.FILTER_XML;
import static org.apache.jackrabbit.vault.util.Constants.META_DIR;
+import static org.apache.jackrabbit.vault.util.Constants.PACKAGE_DEFINITION_XML;
+import static org.apache.jackrabbit.vault.util.Constants.CONFIG_XML;
import static org.apache.jackrabbit.vault.util.Constants.PROPERTIES_XML;
+import static org.apache.jackrabbit.vault.util.Constants.SETTINGS_XML;
import static org.apache.jackrabbit.vault.util.Constants.ROOT_DIR;
import static org.apache.sling.feature.cpconverter.ContentPackage2FeatureModelConverter.PACKAGE_CLASSIFIER;
import static org.apache.sling.feature.cpconverter.vltpkg.VaultPackageUtils.getDependencies;
@@ -64,6 +67,8 @@
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);
@@ -257,6 +262,14 @@
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
new file mode 100644
index 0000000..54a0a38
--- /dev/null
+++ b/src/main/resources/org/apache/sling/feature/cpconverter/vltpkg/config.xml
@@ -0,0 +1,95 @@
+<?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
new file mode 100644
index 0000000..abf67f1
--- /dev/null
+++ b/src/main/resources/org/apache/sling/feature/cpconverter/vltpkg/definition/.content.xml
@@ -0,0 +1,19 @@
+<?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
new file mode 100644
index 0000000..679e6b1
--- /dev/null
+++ b/src/main/resources/org/apache/sling/feature/cpconverter/vltpkg/settings.xml
@@ -0,0 +1,22 @@
+<?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 689b607..801d5b0 100644
--- a/src/test/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverterTest.java
+++ b/src/test/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverterTest.java
@@ -195,6 +195,9 @@
"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",
@@ -202,21 +205,28 @@
"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/content/asd/resources.xml",
+ "jcr_root/config.xml",
+ "jcr_root/definition/.content.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");
+ "jcr_root/settings.xml",
+ "jcr_root/config.xml",
+ "jcr_root/definition/.content.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");
+ "jcr_root/settings.xml",
+ "jcr_root/config.xml",
+ "jcr_root/definition/.content.xml");
} finally {
deleteDirTree(outputDirectory);
}
@@ -313,7 +323,10 @@
"META-INF/vault/filter.xml",
"META-INF/vault/properties.xml",
"jcr_root/.content.xml",
- "jcr_root/testroot/.content.xml");
+ "jcr_root/testroot/.content.xml",
+ "jcr_root/settings.xml",
+ "jcr_root/config.xml",
+ "jcr_root/definition/.content.xml");
verifyPropertiesXmlEntry(expectedPackage, "!installhook.test1.class", "!installhook.test2.class");
} finally {
deleteDirTree(outputDirectory);
@@ -341,7 +354,10 @@
"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/testroot/.content.xml",
+ "jcr_root/settings.xml",
+ "jcr_root/config.xml",
+ "jcr_root/definition/.content.xml");
verifyPropertiesXmlEntry(expectedPackage, "installhook.test1.class", "installhook.test2.class");
} finally {
deleteDirTree(outputDirectory);