{"id":14988307,"url":"https://github.com/apache/sling-org-apache-sling-feature-cpconverter","last_synced_at":"2025-10-19T13:31:08.106Z","repository":{"id":38418754,"uuid":"178027217","full_name":"apache/sling-org-apache-sling-feature-cpconverter","owner":"apache","description":"Apache Sling Content Package to Feature Model Converter","archived":false,"fork":false,"pushed_at":"2024-11-11T11:37:55.000Z","size":20065,"stargazers_count":9,"open_issues_count":5,"forks_count":14,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-01-30T10:06:50.812Z","etag":null,"topics":["java","osgi","osgi-feature-model","sling"],"latest_commit_sha":null,"homepage":"https://sling.apache.org/","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-27T15:50:37.000Z","updated_at":"2024-11-11T11:37:56.000Z","dependencies_parsed_at":"2024-06-22T19:45:36.807Z","dependency_job_id":"1eaa9d3c-8a93-4c90-aca9-c9f9422cf1e9","html_url":"https://github.com/apache/sling-org-apache-sling-feature-cpconverter","commit_stats":{"total_commits":488,"total_committers":29,"mean_commits":16.82758620689655,"dds":0.8442622950819672,"last_synced_commit":"dfa789bb1e399094a0e39b59c240cfbf9c9d2f3e"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fsling-org-apache-sling-feature-cpconverter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fsling-org-apache-sling-feature-cpconverter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fsling-org-apache-sling-feature-cpconverter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fsling-org-apache-sling-feature-cpconverter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/sling-org-apache-sling-feature-cpconverter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237133503,"owners_count":19260495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","osgi","osgi-feature-model","sling"],"created_at":"2024-09-24T14:16:30.012Z","updated_at":"2025-10-19T13:31:02.542Z","avatar_url":"https://github.com/apache.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Apache Sling](https://sling.apache.org/res/logos/sling.png)](https://sling.apache.org)\n\n\u0026#32;[![Build Status](https://ci-builds.apache.org/job/Sling/job/modules/job/sling-org-apache-sling-feature-cpconverter/job/master/badge/icon)](https://ci-builds.apache.org/job/Sling/job/modules/job/sling-org-apache-sling-feature-cpconverter/job/master/)\u0026#32;[![Test Status](https://img.shields.io/jenkins/tests.svg?jobUrl=https://ci-builds.apache.org/job/Sling/job/modules/job/sling-org-apache-sling-feature-cpconverter/job/master/)](https://ci-builds.apache.org/job/Sling/job/modules/job/sling-org-apache-sling-feature-cpconverter/job/master/test/?width=800\u0026height=600)\u0026#32;[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=apache_sling-org-apache-sling-feature-cpconverter\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-cpconverter)\u0026#32;[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=apache_sling-org-apache-sling-feature-cpconverter\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-cpconverter)\u0026#32;[![JavaDoc](https://www.javadoc.io/badge/org.apache.sling/org.apache.sling.feature.cpconverter.svg)](https://www.javadoc.io/doc/org.apache.sling/org.apache.sling.feature.cpconverter)\u0026#32;[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.sling/org.apache.sling.feature.cpconverter/badge.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.apache.sling%22%20a%3A%22org.apache.sling.feature.cpconverter%22)\u0026#32;[![feature](https://sling.apache.org/badges/group-feature.svg)](https://github.com/apache/sling-aggregator/blob/master/docs/groups/feature.md) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n\nThis tool aims to provide to Apache Sling users an easy-to-use conversion tool which is able to convert `content-package` archives to the new _Sling Feature Model_.\n\n## Introduction\n\n`content-package`s are zipped archives containing OSGi bundles, OSGi configurations, JCR nodes/properties and nested `content-package`s as well, aside [metadata](http://jackrabbit.apache.org/filevault/metadata.html), that can be used to install content into a _JCR_ repository using the [Apache Jackrabbit FileVault](http://jackrabbit.apache.org/filevault/) packaging runtime.\n\nOTOH, [Apache Sling Feature](https://github.com/apache/sling-org-apache-sling-feature) allows users to describe an entire OSGi-based application based on reusable components and includes everything related to this application, including bundles, configuration, framework properties, capabilities, requirements and custom artifacts.\n\nThe _Apache Sling Content Package to Feature Model converter_ (referred as _cp2fm_) is a tool able to extract OSGI bundles, OSGi configurations and iteratively scan nested `content-package`s from an input `content-package` and create one (or more) _Apache Sling Feature_ model files and deploy the extracted OSGi bundles in a directory which structure is compliant the _Apache Maven_ repository conventions. The remaining JCR nodes/properties are kept in content packages which are either referenced in the [Sling Feature Model Content Deployment Extension](https://github.com/apache/sling-org-apache-sling-feature-extension-content) section or completely separate from the generated feature model.\n\n## Understanding the Input\n\nAs exposed above, `content-package`s are archives, compressed with the ZIP algorithm, which contain:\n\n* OSGi bundles, conventionally found under the `jcr_root/apps/\u003capplication\u003e/install(.runMode)/\u003cbundle\u003e.jar` path; typically, OSGi bundles are also valid _Apache Maven_ artifacts, that means that they contain _Apache Maven_ metadata files such as `META-INF/maven/\u003cgroupId\u003e/\u003cartifactId\u003e/pom.(xml|properties)`;\n* OSGi configurations, conventionally found under the `jcr_root/apps/\u003capplication\u003e/config(.runMode)/\u003cconfiguration\u003e.\u003cextension\u003e` path;\n* nested `content-package`s, conventionally found under the `jcr_root/etc/packages/\u003cpackage-name\u003e.zip` path;\n* Metadata files, under the `META-INF/` directory;\n* any other kind of resource.\n\n### A content-package sample\n\nWe can have a look at what's inside a `test-content-package.zip` test `content-package` included in the `cp2fm` test resources:\n\n``` bash\n$ unzip -l ./content-package-2-feature-model/src/test/resources/org/apache/sling/cp2fm/test-content-package.zip \nArchive:  content-package-2-feature-model/src/test/resources/org/apache/sling/cp2fm/test-content-package.zip\n  Length      Date    Time    Name\n---------  ---------- -----   ----\n        0  03-12-2019 17:31   META-INF/\n       69  03-12-2019 17:31   META-INF/MANIFEST.MF\n        0  03-12-2019 17:06   jcr_root/\n        0  03-12-2019 17:06   jcr_root/etc/\n        0  03-12-2019 17:06   jcr_root/etc/packages/\n        0  03-12-2019 17:30   jcr_root/etc/packages/asd/\n    34493  03-12-2019 17:30   jcr_root/etc/packages/asd/test-bundles.zip\n     8333  03-12-2019 17:09   jcr_root/etc/packages/asd/test-content.zip\n     7235  03-12-2019 17:08   jcr_root/etc/packages/asd/test-configurations.zip\n        0  03-12-2019 15:28   META-INF/maven/\n        0  03-12-2019 15:29   META-INF/maven/org.apache.sling/\n        0  02-28-2019 14:27   META-INF/maven/org.apache.sling/org.apache.sling.feature.cpconverter.all/\n     1231  03-12-2019 15:30   META-INF/maven/org.apache.sling/org.apache.sling.feature.cpconverter.all/pom.xml\n      127  03-12-2019 15:30   META-INF/maven/org.apache.sling/org.apache.sling.feature.cpconverter.all/pom.properties\n        0  03-12-2019 17:06   META-INF/vault/\n      892  03-12-2019 15:32   META-INF/vault/settings.xml\n      840  03-12-2019 15:47   META-INF/vault/properties.xml\n     3579  03-12-2019 15:33   META-INF/vault/config.xml\n      267  03-12-2019 15:50   META-INF/vault/filter.xml\n---------                     -------\n    63214                     20 files\n```\n\nWhere the `test-bundles.zip` is a nested `content-package` wrapping OSGi bundles:\n\n``` bash\n$ unzip -l test-bundles.zip \nArchive:  test-bundles.zip\n  Length      Date    Time    Name\n---------  ---------- -----   ----\n        0  03-12-2019 17:30   META-INF/\n       69  03-12-2019 17:30   META-INF/MANIFEST.MF\n        0  03-11-2019 23:39   jcr_root/\n        0  03-11-2019 23:31   jcr_root/apps/\n        0  03-12-2019 17:26   jcr_root/apps/asd/\n        0  03-11-2019 23:32   jcr_root/apps/asd/install/\n    13288  12-06-2018 12:30   jcr_root/apps/asd/install/test-framework.jar\n        0  03-12-2019 17:16   jcr_root/apps/asd/install.publish/\n     7210  03-12-2019 17:15   jcr_root/apps/asd/install.publish/test-api.jar\n        0  03-12-2019 17:18   jcr_root/apps/asd/install.author/\n     7735  03-12-2019 17:17   jcr_root/apps/asd/install.author/test-api.jar\n        0  03-11-2019 23:42   META-INF/maven/\n        0  03-11-2019 23:43   META-INF/maven/org.apache.sling/\n        0  02-28-2019 14:26   META-INF/maven/org.apache.sling/org.apache.sling.feature.cpconverter.bundles/\n     1229  03-12-2019 10:22   META-INF/maven/org.apache.sling/org.apache.sling.feature.cpconverter.bundles/pom.xml\n      131  03-12-2019 00:26   META-INF/maven/org.apache.sling/org.apache.sling.feature.cpconverter.bundles/pom.properties\n        0  03-12-2019 12:41   META-INF/vault/\n      888  03-12-2019 00:28   META-INF/vault/settings.xml\n      954  03-12-2019 15:33   META-INF/vault/properties.xml\n     3571  03-12-2019 00:27   META-INF/vault/config.xml\n      891  03-12-2019 00:28   META-INF/vault/filter.xml\n      842  03-12-2019 00:27   META-INF/vault/filter-plugin-generated.xml\n---------                     -------\n    79844                     29 files\n```\n\nthe `test-configurations.zip` contains OSGi configurations:\n\n``` bash\n$ unzip -l test-configurations.zip \nArchive:  test-configurations.zip\n  Length      Date    Time    Name\n---------  ---------- -----   ----\n        0  03-12-2019 17:08   META-INF/\n       69  03-12-2019 17:08   META-INF/MANIFEST.MF\n        0  03-12-2019 10:21   META-INF/maven/\n        0  03-12-2019 10:21   META-INF/maven/org.apache.sling/\n        0  02-28-2019 14:25   META-INF/maven/org.apache.sling/org.apache.sling.feature.cpconverter.config/\n     1228  03-12-2019 10:24   META-INF/maven/org.apache.sling/org.apache.sling.feature.cpconverter.config/pom.xml\n      129  03-12-2019 10:22   META-INF/maven/org.apache.sling/org.apache.sling.feature.cpconverter.config/pom.properties\n        0  03-12-2019 13:23   META-INF/vault/\n       94  02-28-2019 14:25   META-INF/vault/settings.xml\n      664  03-12-2019 15:13   META-INF/vault/properties.xml\n     3579  02-28-2019 14:25   META-INF/vault/config.xml\n      175  03-12-2019 10:37   META-INF/vault/filter.xml\n        0  02-28-2019 14:25   jcr_root/\n        0  03-12-2019 10:17   jcr_root/apps/\n        0  02-28-2019 14:25   jcr_root/apps/asd/\n        0  03-12-2019 10:17   jcr_root/apps/asd/config/\n      438  02-28-2019 14:25   jcr_root/apps/asd/config/org.apache.sling.commons.log.LogManager.factory.config-asd-retail.xml\n        0  03-12-2019 10:18   jcr_root/apps/asd/config.publish/\n      377  02-28-2019 14:25   jcr_root/apps/asd/config.publish/org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-asd-retail.xml\n      244  02-28-2019 14:25   jcr_root/apps/.content.xml\n---------                     -------\n    25441                     23 files\n```\n\nand the `test-content.zip` package includes resources of various nature:\n\n``` bash\n$ unzip -l test-content.zip \nArchive:  test-content.zip\n  Length      Date    Time    Name\n---------  ---------- -----   ----\n        0  03-12-2019 17:09   META-INF/\n       69  03-12-2019 17:09   META-INF/MANIFEST.MF\n        0  03-12-2019 11:31   META-INF/maven/\n        0  03-12-2019 11:31   META-INF/maven/org.apache.sling/\n        0  02-28-2019 14:26   META-INF/maven/org.apache.sling/org.apache.sling.feature.cpconverter.content/\n     1229  03-12-2019 11:32   META-INF/maven/org.apache.sling/org.apache.sling.feature.cpconverter.content/pom.xml\n      131  03-12-2019 11:32   META-INF/maven/org.apache.sling/org.apache.sling.feature.cpconverter.content/pom.properties\n        0  03-12-2019 12:40   META-INF/vault/\n      118  02-28-2019 14:26   META-INF/vault/settings.xml\n      859  03-12-2019 15:12   META-INF/vault/properties.xml\n     3571  03-12-2019 12:42   META-INF/vault/config.xml\n      895  03-12-2019 12:57   META-INF/vault/filter.xml\n       72  02-28-2019 14:26   META-INF/vault/filter-plugin-generated.xml\n        0  03-12-2019 12:30   jcr_root/\n        0  03-12-2019 12:31   jcr_root/content/\n        0  03-12-2019 12:31   jcr_root/content/asd/\n     1021  02-28-2019 14:26   jcr_root/content/asd/.content.xml\n     6924  02-28-2019 14:26   jcr_root/content/asd/resources.xml\n---------                     -------\n    39481                     22 files\n```\n\n### Package Types\n\n`content-package`s have one of [four package types](http://jackrabbit.apache.org/filevault/packagetypes.html).\nBy default type `content` is never referenced inside the feature model (to work with Oak Composite Node Stores), while `application` and `mixed` type's are referenced in the generated feature models. `container` packages are dissolved and all sub packages are flattened (i.e. extracted as individual packages).\n\n## Mapping and the Output\n\nAll metadata are mainly collected inside one or more _Feature_ model files, depending on declared run modes in the installation and configuration paths:\n\n```json\n$ cat asd.retail.all.json \n{\n  \"id\":\"org.apache.sling:asd.retail.all:slingosgifeature:cp2fm-converted-feature:0.0.1\",\n  \"description\":\"Combined package for asd.Retail\",\n  \"bundles\":[\n    {\n      \"id\":\"org.apache.felix:org.apache.felix.framework:6.0.1\",\n      \"start-order\":\"5\"\n    }\n  ],\n  \"configurations\":{\n    \"org.apache.sling.commons.log.LogManager.factory.config-asd-retail\":{\n      \"org.apache.sling.commons.log.pattern\":\"{0,date,yyyy-MM-dd HH:mm:ss.SSS} {4} [{3}] {5}\",\n      \"org.apache.sling.commons.log.names\":[\n        \"we.retail\"\n      ],\n      \"org.apache.sling.commons.log.level\":\"info\",\n      \"org.apache.sling.commons.log.file\":\"logs/project-we-retail.log\"\n    }\n  },\n  \"content-packages:ARTIFACTS|true\":[\n    \"org.apache.sling:asd.retail.all:zip:cp2fm-converted-feature:0.0.1\"\n  ]\n}\n```\n\nthe `publish` run mode leads the tool to generate a separated _Apache Sling Feature_ model file:\n\n```json\n$ cat asd.retail.all-publish.json \n{\n  \"id\":\"org.apache.sling:asd.retail.all:slingosgifeature:cp2fm-converted-feature-publish:0.0.1\",\n  \"bundles\":[\n    {\n      \"id\":\"org.apache.sling:org.apache.sling.models.api:1.3.8\",\n      \"start-order\":\"5\"\n    }\n  ],\n  \"configurations\":{\n    \"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-asd-retail\":{\n      \"user.mapping\":[\n        \"com.asd.sample.we.retail.core:orders=[commerce-orders-service]\",\n        \"com.asd.sample.we.retail.core:frontend=[content-reader-service]\"\n      ]\n    }\n  }\n}\n```\n\n### OSGi Bundles and Content Packages\n\nAll nodes and properties which are not OSGi configurations or bundles are kept in (stripped) content packages. Usually those content packages are referenced inside the Feature Model (evaluated by [Content Handler](https://github.com/apache/sling-org-apache-sling-feature-extension-content/blob/master/src/main/java/org/apache/sling/feature/extension/content/ContentHandler.java)). For packages of type `content` the user can define what to do with those packages (reference in feature model, store in dedicated folder or completely drop). This is useful in more complex deployment scenarios where parts of the repository are swapped via Oak Composite Node Store.\n\nAll detected bundles are collected in an _Apache Maven repository_ compliant directory, all other resources are collected in a new `content-package`, usually classified as `cp2fm-converted-feature`, created while scanning the packages, which contains _content only_.\n\n```bash\n$ tree bundles/\nartifacts/\n└── org\n    └── apache\n        ├── felix\n        │   └── org.apache.felix.framework\n        │       └── 6.0.1\n        │           ├── org.apache.felix.framework-6.0.1.jar\n        │           └── org.apache.felix.framework-6.0.1.pom\n        └── sling\n            ├── asd.retail.all\n            │   └── 0.0.1\n            │       ├── asd.retail.all-0.0.1-cp2fm-converted-feature.zip\n            │       └── asd.retail.all-0.0.1.pom\n            ├── org.apache.sling.api\n            │   └── 2.20.0\n            │       ├── org.apache.sling.api-2.20.0.jar\n            │       └── org.apache.sling.api-2.20.0.pom\n            └── org.apache.sling.models.api\n                └── 1.3.8\n                    ├── org.apache.sling.models.api-1.3.8.jar\n                    └── org.apache.sling.models.api-1.3.8.pom\n\n12 directories, 8 files\n```\n\n#### Sling-Initial Content\n\nBundles containing a [`Sling-Initial-Content` manifest header](https://sling.apache.org/documentation/bundles/content-loading-jcr-contentloader.html) are optionally stripped as well. The contained content in those bundles is converted into content packages or extracted into the feature model. The behaviour of the extraction can be influenced with parameter `--sling-initial-content-policy`.\n\n\n### OSGi Configurations\n\nAll OSGi configuration formats are supported:\n\n* _Property_ files, which extensions are `.properties` or `.cfg`, see the related [documentation](https://sling.apache.org/documentation/bundles/configuration-installer-factory.html#property-files-cfg);\n* Configuration Files, which extension is `.config`, see the related [documentation](https://sling.apache.org/documentation/bundles/configuration-installer-factory.html#configuration-files-config);\n* JSON format, which extension is `.cfg.json`, see the related [documentation](https://blog.osgi.org/2018/06/osgi-r7-highlights-configuration-admin.html)\n* `sling:OsgiConfig` content nodes, typically `.xml` files.\n\nDuring the conversion process, all these formats will be parsed and then added in the `configuration` section of the _Sling Feature Model_ file.\n\n### Run Modes\n\nAs shown above, run modes in the path lead the tool to create a dedicated _Apache Sling Feature_ model file containing all interested OSGi configurations/bundles. Run modes are determined according to the RunModePolicy which by default for backwards compatiblity reasons is DIRECT_ONLY.\nFor DIRECT_ONLY only the direct path leading up to the artifact, while PREPEND_INHERITED makes sure that run modes are inherited downwards and deduplicated (only new ones added).\nRun modes are supported for both OSGi configurations and OSGi bundles.\nThe run mode is extracted from the group named `runmode` from the bundles path applied to the regular expression `/jcr_root/(?:apps|libs)/.+/(?\u003cfoldername\u003einstall|config)(?:\\\\.(?\u003crunmode\u003e[^/]+))?/(?:(?\u003cstartlevel\u003e[0-9]+)/)?.+\\\\.jar`. For OSGi configuration the following regular expression is used: `/jcr_root/(?:apps|libs)/.+/(?\u003cfoldername\u003econfig|install)(\\\\.(?\u003crunmode\u003e[^/]+))?(.*)/(?\u003cpid\u003e[^\\\\/]*)\\\\.\" + extension + (\"(?\u003cdir\u003e.dir(/\\\\.content\\\\.xml)?)?$`.\n\n### Start Level/Order\n\nFor bundles the start order can also be configured.\nThe start order is extracted from the group named `startlevel` from the bundles path applied to the regular expression `/jcr_root/(?:apps|libs)/.+/(?\u003cfoldername\u003einstall|config)(?:\\\\.(?\u003crunmode\u003e[^/]+))?/(?:(?\u003cstartlevel\u003e[0-9]+)/)?.+\\\\.jar`. If there is no start level specified in the path name, the default start order (given via CLI parameter ` --bundles-start-order`) is used.\n\n### Known limitations\n\nMultiple Run Modes are not supported yet.\n\n## Sample APIs\n\n```java\nimport org.apache.sling.feature.cpconverter.ContentPackage2FeatureModelConverter;\nimport org.apache.sling.feature.cpconverter.**.*; // not real Java syntax\n\n...\n\nList\u003cString\u003e apiRegions = ...;\n\nDefaultFeaturesManager featuresManager = new DefaultFeaturesManager(mergeConfigurations,\n                                                                    bundlesStartOrder,\n                                                                    featureModelsOutputDirectory,\n                                                                    artifactIdOverride,\n                                                                    fmPrefix,\n                                                                    properties);\nif (apiRegions != null) {\n    featuresManager.setAPIRegions(apiRegions);\n}\n\nContentPackage2FeatureModelConverter converter = new ContentPackage2FeatureModelConverter(strictValidation)\n                                                 .setFeaturesManager(featuresManager)\n                                                 .setBundlesDeployer(new DefaultArtifactsDeployer(artifactsOutputDirectory))\n                                                 .setEntryHandlersManager(new DefaultEntryHandlersManager())\n                                                 .setAclManager(new DefaultAclManager())\n                                                 .setEmitter(DefaultPackagesEventsEmitter.open(featureModelsOutputDirectory));\n\nif (filteringPatterns != null \u0026\u0026 filteringPatterns.length \u003e 0) {\n    RegexBasedResourceFilter filter = new RegexBasedResourceFilter();\n\n    for (String filteringPattern : filteringPatterns) {\n        filter.addFilteringPattern(filteringPattern);\n    }\n\n    converter.setResourceFilter(filter);\n}\n\nFile[] contentPackages = ...;\n\nconverter.convert(contentPackages);\n```\n\nThe `org.apache.sling.feature.cpconverter.ContentPackage2FeatureModelConverter#convert(File[] contentPackages)` method performs a two-phases algorithm, which:\n\n* all content-packages dependencies are computed in order to built the correct content-packages processing sequence;\n* all entries of each content-package is scanned and processed accordingly.\n\n### Features Manager service\n\nThe [org.apache.sling.feature.cpconverter.features.FeaturesManager](./src/main/java/org/apache/sling/feature/cpconverter/features/FeaturesManager.java), backed by the default implementation [org.apache.sling.feature.cpconverter.features.DefaultFeaturesManager](./src/main/java/org/apache/sling/feature/cpconverter/features/DefaultFeaturesManager.java), is the service responsible to build and collect the Feature Models while scanning the input content-packages.\n\nThe additional [org.apache.sling.feature.cpconverter.features.RunmodeMapper](./src/main/java/org/apache/sling/feature/cpconverter/features/RunmodeMapper.java) component, embedded in the `DefaultFeaturesManager`, will take care to create a `runmode.mapping`, in the same Feature Model target directory, where all features will be indexed by runmodes, i.e.:\n\n``` bash\n$ cat /my-target-project/src/main/features/runmode.mapping \n#File edited by the Apache Sling Content Package to Sling Feature converter\n#Fri Aug 30 12:47:56 CEST 2019\nproduction=org.apache.test.mytest-sample-site.ui.apps-production.json,org.apache.test.components.all-production.json\n(default)=org.apache.test.mytest-sample-site.ui.content.json,org.apache.test.mytest-sample-site.ui.apps.json,org.apache.test.components.all.json\n```\n\n### Bundles deployer\n\nThe [org.apache.sling.feature.cpconverter.artifacts.ArtifactsDeployer](./src/main/java/org/apache/sling/feature/cpconverter/artifacts/ArtifactsDeployer.java) service is designed to let the conversion tool be integrated in external services, i.e. _Apache Maven_.\n\nThe [default implementation](./src/main/java/org/apache/sling/feature/cpconverter/artifacts/LocalMavenRepositoryArtifactsDeployer.java) just copies bundles in the target output directory, according to the _Apache Maven_ repository layout.\n\nBundles are collected in an _Apache Maven repository_ compliant directory, all other resources are collected in a new `content-package` created while scanning the packages:\n\n``` bash\n$ tree bundles/\nartifacts/\n└── org\n    └── apache\n        ├── felix\n        │   └── org.apache.felix.framework\n        │       └── 6.0.1\n        │           ├── org.apache.felix.framework-6.0.1.jar\n        │           └── org.apache.felix.framework-6.0.1.pom\n        └── sling\n            ├── asd.retail.all\n            │   └── 0.0.1\n            │       ├── asd.retail.all-0.0.1-cp2fm-converted-feature.zip\n            │       └── asd.retail.all-0.0.1.pom\n            ├── org.apache.sling.api\n            │   └── 2.20.0\n            │       ├── org.apache.sling.api-2.20.0.jar\n            │       └── org.apache.sling.api-2.20.0.pom\n            └── org.apache.sling.models.api\n                └── 1.3.8\n                    ├── org.apache.sling.models.api-1.3.8.jar\n                    └── org.apache.sling.models.api-1.3.8.pom\n\n12 directories, 8 files\n```\n\n_Apache Maven GAVs_ are extracted from nested bundles metadata and are renamed according to the _Apache Maven_ conventions; if no _Apache Maven GAVs_ are provided, OSGi `Bundle-SymbolicName`, `Bundle-Name` and `Bundle-Version` metadata will be used to supply the missing informations.\n\n#### Local Maven Repo as Cache\n\nThe converter will create a Maven Dependency folder structure and create a POM file for any converted Content Package file.\nThis will allow subsequent Feature tools to find and process them.\n\nThe **group and artifact id** of the converted Content Package and Bundles is taken from the file itself (Content Package's Vault Properties file, Bundle's Headers).\nBecause these sources might not correspond with the CPs or Bundles regular Maven place the Converter will place them accordingly to the found data hence in a new place.\n\nThis does not bother the Sling Feature Maven Plugin nor the Feature Launcher as they are still able to find the dependencies if placed in the Local Maven Repo.\n\n### Handler Service\n\nIn order to make the tool extensible, the [org.apache.sling.feature.cpconverter.handlers.EntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/spi/EntryHandler.java) interface is declared to handle different kind of resources, have a look at the [org.apache.sling.feature.cpconverter.handlers](src/main/java/org/apache/sling/feature/cpconverter/handlers) package to see the default implementations.\n\nIf users want to handle special resource type, all they have to do is providing their `org.apache.sling.feature.cpconverter.handlers.EntryHandler` service implementation and declaring them in the `META-INF/services/org.apache.sling.feature.cpconverter.handlers.EntryHandler` classpath resource file, on order to let the `ServiceLoader` including it in the `content-package` scan.\n\nAll handlers are managed by the [org.apache.sling.feature.cpconverter.handlers.EntryHandlersManager](./src/main/java/org/apache/sling/feature/cpconverter/spi/EntryHandlersManager.java) service, which default implementation is [org.apache.sling.feature.cpconverter.handlers.DefaultEntryHandlersManager](./src/main/java/org/apache/sling/feature/cpconverter/spi/DefaultEntryHandlersManager.java)\n\n#### Built-in handlers\n\n|  Entry type | Entry regular expression | Handler |\n|:-----------:|:------------------------:|:-------:|\n| Node types | `/META-INF/vault/nodetypes\\.cnd` | [org.apache.sling.feature.cpconverter.handlers.NodeTypesEntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/NodeTypesEntryHandler.java) |\n| Privileges | `/META-INF/vault/privileges\\.xml` | [org.apache.sling.feature.cpconverter.handlers.PrivilegesHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/PrivilegesHandler.java) |\n| Rep Policy | `/jcr_root(*/)_rep_policy.xml` | [org.apache.sling.feature.cpconverter.handlers.RepPolicyEntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/RepPolicyEntryHandler.java) |\n| Rep Repo Policy | `/jcr_root(*/)_rep_policy.xml` | [org.apache.sling.feature.cpconverter.handlers.RepRepoPolicyEntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/RepRepoPolicyEntryHandler.java) |\n| Rep Principal Policy | `/jcr_root(/)_rep_repoPolicy.xml` | [org.apache.sling.feature.cpconverter.handlers.RepPrincipalPolicyEntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/RepPrincipalPolicyEntryHandler.java) |\n| (System) Users | `/jcr_root(/home/users/*/)\\.content.xml` | [org.apache.sling.feature.cpconverter.handlers.UsersEntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/UsersEntryHandler.java) |\n| Groups | `/jcr_root(/home/groups/*/)\\.content.xml` | [org.apache.sling.feature.cpconverter.handlers.GroupEntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/GroupEntryHandler.java) |\n| Sub content-packages | `/jcr_root/(etc/packages\\|apps/*/install[\\.${runMode}]/*.zip` | [org.apache.sling.feature.cpconverter.handlers.ContentPackageEntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/ContentPackageEntryHandler.java) |\n| OSGi Bundle | `/jcr_root/(apps\\|libs)/*/install[\\.${runMode}]/[startLevel/]*.jar` | [org.apache.sling.feature.cpconverter.handlers.BundleEntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java) |\n| OSGi Configuration | `/jcr_root/(apps\\|libs)/*/config[\\.${runMode}]/*.config` | [org.apache.sling.feature.cpconverter.handlers.ConfigurationEntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/ConfigurationEntryHandler.java) |\n| OSGi JSON Configuration | `/jcr_root/(apps\\|libs)/*/config[\\.${runMode}]/*.cfg.json` | [org.apache.sling.feature.cpconverter.handlers.JsonConfigurationEntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/JsonConfigurationEntryHandler.java) |\n| OSGi Properties Configuration | `/jcr_root/(apps\\|libs)/*/config[.${runMode}]/*.cfg.properties` | [org.apache.sling.feature.cpconverter.handlers.PropertiesConfigurationEntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/PropertiesConfigurationEntryHandler.java) |\n| OSGi XML Configuration | `/jcr_root/(apps\\|libs)/*/config[\\.${runMode}]/*.xml` | [org.apache.sling.feature.cpconverter.handlers.XmlConfigurationEntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/XmlConfigurationEntryHandler.java) |\n\nEverything else, unless users will deploy in the classpath a custom `org.apache.sling.feature.cpconverter.handlers.EntryHandler` implementation, is considered as part of the final content-package, handled by the [org.apache.sling.feature.cpconverter.handlers.ContentPackageEntryHandler](./src/main/java/org/apache/sling/feature/cpconverter/handlers/ContentPackageEntryHandler.java)\n\n### ACL Management\n\nWhile scanning the input content-package(s), all ACLs entries are handled by the [org.apache.sling.feature.cpconverter.acl.AclManager](./src/main/java/org/apache/sling/feature/cpconverter/accesscontrol/AclManager.java) service which is in charge of collecting and computing:\n\n* System Users;\n* System Users related ACLs;\n* Privileges;\n* Node types registrations;\n* Any `repoinit` additional instruction.\n\nDefault implementation is provided by [org.apache.sling.feature.cpconverter.acl.DefaultAclManager](./src/main/java/org/apache/sling/feature/cpconverter/accesscontrol/DefaultAclManager.java).\n\nWhen using a seed feature, repoinit instructions will be parsed to extract system user ids. The supported repoinit instructions are the ones known to the Repoinit Parser version 1.9.0.\n\n#### Please note\n\nACLs are set in the `repoinit` section for detected System Users _only_, all other ACLs will be 1:1 copied in the related `/jcr_root(/home/users/*/)\\.content.xml` file, which will contain filtered ACLs.\n\n### Content-Packages events\n\nSAX-alike events are emitted while processing input (sub-)content-packages, all them are handled by the [org.apache.sling.feature.cpconverter.vltpkg.PackagesEventsEmitter](./src/main/java/org/apache/sling/feature/cpconverter/vltpkg/PackagesEventsEmitter.java).\n\nThe default implementation [org.apache.sling.feature.cpconverter.vltpkg.DefaultPackagesEventsEmitter](./src/main/java/org/apache/sling/feature/cpconverter/vltpkg/DefaultPackagesEventsEmitter.java) will take care of creating, in the same Feature Model target directory, a `content-packages.csv` index file, where all (sub-)content-packages will be enlisted with their related complete path, i.e.:\n\n```bash\n# File created on Fri Aug 30 12:47:55 CEST 2019 by the Apache Sling Content Package to Sling Feature converter\n# content-package path, content-package ID, content-package type, content-package parent ID, path in parent content-package, absolute path\n/Users/asfuser/content-packages/org.apache.test.components.all-2.5.1-SNAPSHOT.zip,org/apache/test:org.apache.test.components.all:2.5.1-SNAPSHOT,MIXED,,,\n/Users/asfuser/content-packages/org.apache.test.components.all-2.5.1-SNAPSHOT.zip,org/apache/test:org.apache.test.components.content:2.5.1-SNAPSHOT,APPLICATION,org/apache/test:org.apache.test.components.all:2.5.1-SNAPSHOT,/jcr_root/etc/packages/org/apache/test/org.apache.test.components.content-2.5.1-SNAPSHOT.zip,/Users/asfuser/content-packages/org.apache.test.components.all-2.5.1-SNAPSHOT.zip!/jcr_root/etc/packages/org/apache/test/org.apache.test.components.content-2.5.1-SNAPSHOT.zip\n/Users/asfuser/content-packages/org.apache.test.components.all-2.5.1-SNAPSHOT.zip,org/apache/test:org.apache.test.components.config:2.5.1-SNAPSHOT,APPLICATION,org/apache/test:org.apache.test.components.all:2.5.1-SNAPSHOT,/jcr_root/etc/packages/org/apache/test/org.apache.test.components.config-2.5.1-SNAPSHOT.zip,/Users/asfuser/content-packages/org.apache.test.components.all-2.5.1-SNAPSHOT.zip!/jcr_root/etc/packages/org/apache/test/org.apache.test.components.config-2.5.1-SNAPSHOT.zip\n```\n\nThe `!` character is used to separate nested sub-content-packages path.\n\n## The CLI Tool\n\nThe tool is distributed with a commodity package containing all is needed in order to launch the `ContentPackage2FeatureModelConverter` from the shell:\n\n```bash\n$ unzip -l org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT.zip \nArchive:  org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT.zip\n  Length      Date    Time    Name\n---------  ---------- -----   ----\n        0  03-13-2019 15:58   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/\n        0  03-13-2019 15:58   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/bin/\n        0  03-13-2019 15:58   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/\n     4605  02-27-2019 16:30   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/README.md\n   801904  02-28-2019 14:55   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/jackrabbit-spi-commons-2.19.1.jar\n    14744  02-11-2019 15:44   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/osgi.annotation-6.0.1.jar\n    35919  02-11-2019 15:44   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/org.osgi.service.component.annotations-1.3.0.jar\n    23575  02-11-2019 15:44   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/org.osgi.service.metatype.annotations-1.3.0.jar\n    34518  02-27-2019 15:28   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/org.apache.felix.scr.annotations-1.11.0.jar\n    45199  03-13-2019 15:58   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT.jar\n    17489  03-13-2019 15:58   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/LICENSE\n   588337  02-11-2019 12:49   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/commons-collections-3.2.2.jar\n   108555  02-11-2019 15:45   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/xz-1.8.jar\n    52873  03-05-2019 17:31   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/plexus-classworlds-2.6.0.jar\n   165965  03-05-2019 18:02   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/maven-model-3.6.0.jar\n      178  02-27-2019 15:56   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/NOTICE\n   745712  02-28-2019 10:02   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/org.apache.jackrabbit.vault-3.2.6.jar\n  2374421  02-27-2019 15:28   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/biz.aQute.bndlib-3.2.0.jar\n     3263  03-13-2019 15:58   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/bin/cp2fm.bat\n    69246  02-11-2019 12:49   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/jcr-2.0.jar\n   113508  02-11-2019 12:36   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/org.apache.felix.converter-1.0.0.jar\n    12548  02-11-2019 12:36   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/org.osgi.util.function-1.0.0.jar\n   176142  02-11-2019 12:35   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/org.apache.felix.utils-1.11.0.jar\n   155618  03-04-2019 00:12   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/org.apache.felix.configadmin-1.9.12.jar\n    75443  03-05-2019 14:58   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/plexus-io-3.1.1.jar\n    57954  02-11-2019 12:39   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/snappy-0.4.jar\n   148098  02-11-2019 12:39   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/xbean-reflect-3.7.jar\n     3808  03-13-2019 15:58   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/bin/cp2fm\n   214788  02-11-2019 15:44   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/commons-io-2.6.jar\n    26081  02-11-2019 12:36   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/geronimo-json_1.0_spec-1.0-alpha-1.jar\n    90358  02-11-2019 12:35   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/johnzon-core-1.0.0.jar\n    14769  02-11-2019 12:35   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/org.osgi.annotation.versioning-1.0.0.jar\n   475256  02-11-2019 12:35   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/osgi.core-6.0.0.jar\n    28688  02-11-2019 12:48   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/slf4j-api-1.7.6.jar\n    28561  02-28-2019 14:55   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/jackrabbit-spi-2.19.1.jar\n   403186  02-28-2019 14:55   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/jackrabbit-jcr-commons-2.19.1.jar\n    49017  03-04-2019 15:12   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/jackrabbit-api-2.19.1.jar\n   260371  03-05-2019 14:58   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/plexus-utils-3.1.1.jar\n   639592  02-11-2019 12:39   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/google-collections-1.0.jar\n    10684  02-11-2019 12:48   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/slf4j-simple-1.7.6.jar\n   164159  02-11-2019 12:48   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/org.apache.sling.feature.io-1.0.0.jar\n   289040  02-11-2019 12:36   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/org.apache.felix.configurator-1.0.4.jar\n   591748  02-11-2019 15:45   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/commons-compress-1.18.jar\n   242435  02-27-2019 15:58   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/picocli-3.6.0.jar\n   115238  02-11-2019 12:48   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/org.apache.sling.feature-1.0.0.jar\n    18587  02-11-2019 15:46   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/annotations-16.0.3.jar\n   191914  03-05-2019 14:58   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/plexus-archiver-4.1.0.jar\n   229982  03-05-2019 17:31   org.apache.sling.feature.cpconverter-0.0.1-SNAPSHOT/lib/plexus-container-default-2.0.0.jar\n---------                     -------\n  9914076                     48 files\n```\n\nonce the package is decompressed, open the shell and type:\n\n```bash\n$ ./bin/cp2fm -h\nUsage: cp2fm [-hmqsvXZ] [--disable-installer-policy]\n             [--enforce-servicemapping-by-principal] [--remove-install-hooks]\n             [--content-type-package-policy=\u003ccontentTypePackagePolicy\u003e]\n             [--enforce-principal-based-supported-path=\u003cenforcePrincipalBasedSup\n             portedPath\u003e] [--seed-feature=\u003cseedFeature\u003e]\n             [--system-user-rel-path=\u003csystemUserRelPath\u003e]\n             -a=\u003cartifactsOutputDirectory\u003e [-b=\u003cbundlesStartOrder\u003e]\n             [-e=\u003cexportsToRegion\u003e] [-i=\u003cartifactIdOverride\u003e]\n             -o=\u003cfeatureModelsOutputDirectory\u003e [-p=\u003cfmPrefix\u003e]\n             [-u=\u003cunreferencedArtifactsOutputDirectory\u003e]\n             [--entry-handler-config=\u003centryHandlerConfigs\u003e]...\n             [-D=\u003cString=String\u003e]... [-f=\u003cfilteringPatterns\u003e]...\n             [-r=\u003capiRegions\u003e]... content-packages...\nApache Sling Content Package to Sling Feature converter\n      content-packages...   The content-package input file(s).\n      --content-type-package-policy=\u003ccontentTypePackagePolicy\u003e\n                            Determines what to do with converted packages of type\n                              'content'. Valid values: REFERENCE, DROP,\n                              PUT_IN_DEDICATED_FOLDER.\n                              Default: DROP\n      --disable-installer-policy\n                            Disables enforcing that OSGi configurations are only\n                              allowed below a folder called 'config' and OSGi\n                              bundles are only allowed below a folder called\n                              'install'. Instead both are detected below either\n                              'install' or 'config'.\n      --enforce-principal-based-supported-path=\u003cenforcePrincipalBasedSupportedPath\u003e\n                            Converts service user access control entries to\n                              principal-based setup using the given supported path.\n      --enforce-servicemapping-by-principal\n                            Converts service user mappings with the form 'service:\n                              sub=userID' to 'service:sub=[principalname]'. Note,\n                              this may result in group membership no longer being\n                              resolved upon service login.\n      --entry-handler-config=\u003centryHandlerConfigs\u003e\n                            Config for entry handlers that support it (classname:\n                              \u003cconfig-string\u003e\n      --remove-install-hooks\n                            Removes both internal and external hooks from processed\n                              packages\n      --run-mode-policy=\u003crunModePolicy\u003e\n                            Determines how to determine the final run mode of an\n                              artifact. DIRECT_ONLY uses only the run modes of the\n                              containing path while PREPEND_INHERITED inherits the\n                              run modes affecting the parent package. Valid values:\n                              DIRECT_ONLY, PREPEND_INHERITED.\n                              Default: DIRECT_ONLY\n      --seed-feature=\u003cseedFeature\u003e\n                            A url pointing to a feature that can be assumed to be\n                              around when the conversion result will be used\n      --sling-initial-content-policy=\u003cslingInitialContentPolicy\u003e\n                            Determines what to do with Sling-Initial-Content found\n                              in embedded bundles. Valid values: KEEP,\n                              EXTRACT_AND_REMOVE, EXTRACT_AND_KEEP.\n                              Default: KEEP\n      --system-user-rel-path=\u003csystemUserRelPath\u003e\n                            Relative path for system user as configured with Apache\n                              Jackrabbit Oak\n  -a, --artifacts-output-directory=\u003cartifactsOutputDirectory\u003e\n                            The output directory where the artifacts will be\n                              deployed.\n  -b, --bundles-start-order=\u003cbundlesStartOrder\u003e\n                            The default start order in which to start detected bundles.\n  -D, --define=\u003cString=String\u003e\n                            Define a system property\n  -e, --exports-to-region=\u003cexportsToRegion\u003e\n                            Packages exported by bundles in the content packages are\n                              exported in the named region\n  -f, --filtering-patterns=\u003cfilteringPatterns\u003e\n                            Regex based pattern(s) to reject content-package archive\n                              entries.\n  -h, --help                Display the usage message.\n  -i, --artifact-id=\u003cartifactIdOverride\u003e\n                            The optional Artifact Id the Feature File will have,\n                              once generated; it will be derived, if not specified.\n  -m, --merge-configurations\n                            Flag to mark OSGi configurations with same PID will be\n                              merged, the tool will fail otherwise.\n  -o, --features-output-directory=\u003cfeatureModelsOutputDirectory\u003e\n                            The output directory where the Feature File will be\n                              generated.\n  -p, --fm-prefix=\u003cfmPrefix\u003e\n                            The optional prefix of the output file\n  -q, --quiet               Log errors only.\n  -r, --api-region=\u003capiRegions\u003e\n                            The API Regions assigned to the generated features\n  -s, --strict-validation   Flag to mark the content-package input file being strict\n                              validated.\n  -u, --unreferenced-artifacts-output-directory=\u003cunreferencedArtifactsOutputDirectory\n        \u003e\n                            The output directory where unreferenced artifacts will\n                              be deployed.\n  -v, --version             Display version information.\n  -X, --verbose             Produce execution debug output.\n  -Z, --fail-on-mixed-packages\n                            Fail the conversion if the resulting attached\n                              content-package is MIXED type\nCopyright(c) 2019-2021 The Apache Software Foundation.\n```\n\nto see all the available options; a sample execution could look like:\n\n``` bash\n\u003e ./bin/cp2fm -v -b 20 -c /content-package-2-feature-model/src/test/resources/org/apache/sling/cp2fm/test-content-package.zip -a /cache -o /tmp\n```\n\nArgument Files for Long Command Lines:\n\n```bash\n# argfile\n# comments are supported\n\n-v\n-b 20\n-c /content-package-2-feature-model/src/test/resources/org/apache/sling/cp2fm/test-content-package.zip\n-o /tmp\n```\n\nthen execute the command\n\n```bash\n\u003e ./bin/cp2fm @argfile\n```\n\n## Failures and Restrictions\n\nThere could be cases where default handlers would be not enough to create pure content `content-package` archives, by enabling the `-Z` option in the CLI tool, or via [ContentPackage2FeatureModelConverter#setFailOnMixedPackages(boolean)](./src/main/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverter.java#L151) API, the converter will fail the process if the resulting `content-package` is of MIXED type.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fsling-org-apache-sling-feature-cpconverter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fsling-org-apache-sling-feature-cpconverter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fsling-org-apache-sling-feature-cpconverter/lists"}