
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@adobe/aem-cs-source-migration-repository-modernizer
Advanced tools
AEM as a Cloud Service Project Restructuring tool
aem-cs-source-migration-repository-modernizer
provides the capability to restructure existing projects packages into
AEM as a CLoud Service compatible packages.
AEM requires a separation of content and code, which means a single content package cannot deploy
to both /apps
and runtime-writable areas (e.g. /content
, /conf
, /home
, or anything not
/apps
) of the repository. Instead, the application must separate code and content into discrete
packages for deployment into AEM.
Adobe Experience Manager Maven projects to be AEM Cloud Service compatible, need to ensure that
The objective of this tool is to modernize any given project(s) into AEM Cloud Service compatible structure, by creating the following deployment structure :
ui.apps
package, or Code Package, contains all the code to be deployed and only deploys
to /apps
ui.config
package, or OSGi Configuration Package, contains all OSGi configurationsui.content
package, or Content Package, contains all content and configurationall
package, container package that embeds the core bundles and the ui.apps ,ui.config
and ui.content packagesall
package analyse
package and parent pom.xml file
at the root level.ui.apps
, ui.apps.structure
,
ui.content
and ui.config
packages at the same level.ui.apps
,ui.apps.structure
, ui.content
and ui.config
packages.ui.apps
, ui.apps.structure
,
ui.content
and ui.config
for sub-projects as well.groupId
, artifactId
and version
in the newly created artifact pom.xml
files.content-package
(other than the packages specified under existingContentPackageFolder
) from the source.all/pom.xml
.existingContentPackageFolder
and separate the mutable and immutable content
according to their paths.ui.apps
and ui.content
packages
as applicable.osgiFoldersToRename
.
ui.apps
package to the ui.configs
package
(under the path /apps/my-app/osgiconfig
)..cfg.json
format.NOTE : Conflicts during the above move operation will be reported and conflicting content needs to be moved over manually.
existingContentPackageFolder
and extract the filter paths specified in their
filter.xml
files.ui.apps
and ui.content
packages' filter
file as applicable.ui.apps.structure/pom.xml
, define the JCR repository roots in which the project’s code
sub-packages deploy into (i.e. enumerate the filter root paths present in ui.apps
package's
filter.xml
)./apps/my-app/osgiconfig
in ui.configs
package's filter file.existingContentPackageFolder
and extract the dependency and
plugin info. They will be added to the ui.apps/pom.xml
file.
NOTE :
uber-jar
dependencies will be replaced with aem-sdk-api
dependenciesnonadobedependencies
directory (which would serve as a
local repository for 3rd party bundles). It will be included in the repository section of
the parent pom.ui.apps/pom.xml
add the dependency for the ui.apps.structure
artifact.ui.content/pom.xml
add the dependency for the ui.apps
artifact.all/pom.xml
embed the newly created ui.apps
,ui.config
and ui.config
artifacts
for each project.ui.apps/pom.xml
, ui.content/pom.xml
and
ui.config/pom.xml
for each project.uber-jar
dependency with aem-sdk-api
dependency.While it is recommended to use this tool via our AIO CLI plugin for source migration (refer to aio-cli-plugin-aem-cloud-service-migration), it can also be executed standalone.
This project uses node and npm. Go check them out if you don't have them locally installed.
It can be installed like any other Node.js module.
$ npm install @adobe/aem-cs-source-migration-repository-modernizer
To add the module to your Node.js
project:
require
function in the module in the javascript file where it will be consumed:const RepositoryModernizer = require('@adobe/aem-cs-source-migration-repository-modernizer');
To execute the repository-modernizer tool locally :
git clone git@github.com:adobe/aem-cloud-service-source-migration.git
to clone the
repository locallyrepository-modernizer
foldernpm install
to install all the required dependenciesexecutors
folder:
config.yaml
. Refer to Configurations
sections bellow to know more.node repository-modernizer.js
to execute the tooltarget/project/src/
will contain the resulting restructured projectsThe repository modernizer expects the following configurations to be specified for execution :
groupId
: The groupId
to be used for newly created artifacts.
parentPom
: Add the required information about parent pom
path
: The absolute path to the existing parent pom file.artifactId
: The artifactId
to be set for the parent pom.appTitle
: The application title to be set for the parent pom.version
: The version to be set for the parent pom.all
: Add the required information for all
and analyse
packages
artifactId
: The prefix that is to be used to set the artifactId for the all
and analyse
packages.appTitle
: The application title.version
: The version to be set for the all pom.projects
: Add the required information about all the projects you want to restructure.
(NOTE : Expects an array of project details objects.)
(NOTE : For multiple projects create separate copies of the info section for each project)
projectPath
: The absolute path to the project folder.
existingContentPackageFolder
: relative path(s) (w.r.t. the project folder) to the existing
content package(s) that needs to be restructured.
(NOTE : Expects an array of relative paths to existing content packages, NOT bundle/jar artifacts.)
relativePathToExistingFilterXml
: The relative path (w.r.t. the existing content package
folder) to the vault filter.xml file. For example : /src/main/content/META-INF/vault/filter.xml
relativePathToExistingJcrRoot
: The relative path (w.r.t. the existing content package
folder) to the jcr_root directory. For example : /src/main/content/jcr_root
artifactId
: The prefix that is to be used to set the artifactId for all newly
created ui.apps
and ui.content
packages.
appTitle
: The application title.
version
: The version used for content packages.
appId
: The application Id.
coreBundles
: Array of relative path(s) (w.r.t. the project folder) to the existing code bundles
(these bundles will be embedded in the all
package).
osgiFoldersToRename
: OSGi config folders that need to be renamed. The existing/source OSGi
config folder PATH (JCR path starting from '/apps') is expected as key, and the replacement OSGi
folder NAME is expected as value.
(NOTE 1 : All OSGi config folders under the same path and with same replacement name will be MERGED.)
(NOTE 2 : If there exists OSGi config files with the same pid/filename in more than one config folders which are to be merged, they will not be overwritten. A warning regrading the same will be generated in the summary report and result log file. User would need to manually evaluate which config to persist.)
Example:
repositoryModernizer:
# groupId to be used for newly created packages
groupId: com-xyz-aem
# information about parent pom
parentPom:
# absolute path to the parent pom file
path: /Users/{username}/some/path/to/xyz-aem/pom.xml
# the artifactId to be set for the parent pom
artifactId: xyz-aem-parent
# the application title to be set for the parent pom
appTitle: XYZ-AEM Parent
# version to be to be set for the parent pom
version: 1.0.0-SNAPSHOT
# information required for all and analyse packages
all:
# prefix that is to be used to set the artifactId for all and analyse packages
artifactId: xyz-aem
# application title
appTitle: XYZ-AEM Code Repository
# version to be set for all pom
version: 1.0.0-SNAPSHOT
# information about projects (expects an array of project information)
# NOTE : For multiple projects create separate copies of the info section for each project
projects:
- # absolute path to the XYZ project folder
projectPath: /Users/{username}/some/path/to/xyz-aem
# Array of relative path(s) (w.r.t. the project folder) to the existing content package(s) that needs to be restructured.
# NOTE : only content packages are expected here, NOT bundle/jar artifacts
existingContentPackageFolder:
- /ui.apps
- /ui.content
- /ui.permissions
# relative path (w.r.t. the existing content package folder) to the filter.xml file
# (If not specified, default path `/src/main/content/META-INF/vault/filter.xml` will be used.)
relativePathToExistingFilterXml:
# relative path (w.r.t. the existing content package folder) to the jcr_root directory
# (If not specified, default path `/src/main/content/jcr_root` will be used)
relativePathToExistingJcrRoot:
# prefix that is to be used to set the artifactId for newly created ui.apps and ui.content packages
artifactId: xyz-content-aem
# application title
appTitle: XYZ
# application ID (will be used for config and package folder names)
appId: xyz-app
# project specific version to be used for content packages
version: 2.0.0-SNAPSHOT
# Array of relative path(s) (w.r.t. the project folder) to the existing code bundles (will be embedded in the all package).
coreBundles:
- /core
- /api
# OSGi config folders that need to be renamed.
# The existing/source OSGi config folder PATH (JCR path starting from '/apps') is expected as key
# and the replacement OSGi folder NAME is expected as value. See examples below :
# /apps/xyz/config.prod : config.publish.prod
# /apps/system/config.author.dev1 : config.author.dev
# /apps/system/config.author.dev2 : config.author.dev
# NOTE :
# 1. All OSGi config folders under the same path and with same replacement name will be MERGED
# (as configured in above example).
# 2. If there exists OSGi config files with the same pid/filename in more than one config folders
# which are to be merged, they will not be overwritten. A warning regrading the same will be
# generated in the summary report and result log file. User would need to manually evaluate
# which config to persist
osgiFoldersToRename:
/apps/xyz/config.dev1: config.author.dev
/apps/xyz/config.dev2: config.author.dev
/apps/system/config.author.localdev: config.author.dev
/apps/system/config.author.dev1: config.author.dev
/apps/system/config.prod: config.publish.prod
/apps/system/config.publish: config.publish.prod
subProjects:
- # absolute path to the XYZ sub-project folder
projectPath: /Users/{username}/some/path/to/xyz-aem/sub-project
# Array of relative path(s) (w.r.t. the project folder) to the existing content package(s) that needs to be restructured.
# NOTE : only content packages are expected here, NOT bundle/jar artifacts
existingContentPackageFolder:
- /ui.apps
- /ui.content
- /ui.permissions
# relative path (w.r.t. the existing content package folder) to the filter.xml file
# (If not specified, default path `/src/main/content/META-INF/vault/filter.xml` will be used.)
relativePathToExistingFilterXml:
# relative path (w.r.t. the existing content package folder) to the jcr_root directory
# (If not specified, default path `/src/main/content/jcr_root` will be used)
relativePathToExistingJcrRoot:
# prefix that is to be used to set the artifactId for newly created ui.apps and ui.content packages
artifactId: xyz-content-aem-sub-project
# application title
appTitle: XYZ-SUB-PROJECT
# application ID (will be used for config and package folder names)
appId: xyz-app-sub-project
# project specific version to be used for content packages
version: 2.0.0-SNAPSHOT
# Array of relative path(s) (w.r.t. the project folder) to the existing code bundles (will be embedded in the all package).
coreBundles:
- /core
- /api
# OSGi config folders that need to be renamed.
# The existing/source OSGi config folder PATH (JCR path starting from '/apps') is expected as key
# and the replacement OSGi folder NAME is expected as value. See examples below :
# /apps/xyz/config.prod : config.publish.prod
# /apps/system/config.author.dev1 : config.author.dev
# /apps/system/config.author.dev2 : config.author.dev
# NOTE :
# 1. All OSGi config folders under the same path and with same replacement name will be MERGED
# (as configured in above example).
# 2. If there exists OSGi config files with the same pid/filename in more than one config folders
# which are to be merged, they will not be overwritten. A warning regrading the same will be
# generated in the summary report and result log file. User would need to manually evaluate
# which config to persist
osgiFoldersToRename:
/apps/xyz/config.dev1: config.author.dev
/apps/xyz/config.dev2: config.author.dev
/apps/system/config.author.localdev: config.author.dev
/apps/system/config.author.dev1: config.author.dev
/apps/system/config.prod: config.publish.prod
/apps/system/config.publish: config.publish.prod
- # absolute path to the ABC project folder
projectPath: /Users/{username}/some/path/to/abc-aem
# Array of relative path(s) (w.r.t. the project folder) to the existing content package(s) that needs to be restructured.
# NOTE : only content packages are expected here, NOT bundle/jar artifacts
existingContentPackageFolder:
- /content
- /oak-index-definitions
# relative path (w.r.t. the existing content package folder) to the filter.xml file
# (If not specified, default path `/src/main/content/META-INF/vault/filter.xml` will be used.)
relativePathToExistingFilterXml:
# relative path (w.r.t. the existing content package folder) to the jcr_root directory
# (If not specified, default path `/src/main/content/jcr_root` will be used)
relativePathToExistingJcrRoot:
# prefix that is to be used to set the artifactId for newly created ui.apps and ui.content packages
artifactId: abc-content-aem
# application title
appTitle: ABC
# application ID (will be used for config and package folder names)
appId: abc-app
# project specific version to be used for content packages
version: 2.0.0-SNAPSHOT
# Array of relative path(s) (w.r.t. the project folder) to the existing code bundles (will be embedded in the all package).
coreBundles:
- /core
# OSGi config folders that need to be renamed.
# The existing/source OSGi config folder PATH (JCR path starting from '/apps') is expected as key
# and the replacement OSGi folder NAME is expected as value. See examples below :
# /apps/my-appId/config.prod : config.publish.prod
# /apps/system/config.author.dev1 : config.author.dev
# /apps/system/config.author.dev2 : config.author.dev
# NOTE :
# 1. All OSGi config folders under the same path and with same replacement name will be MERGED
# (as configured in above example).
# 2. If there exists OSGi config files with the same pid/filename in more than one config folders
# which are to be merged, they will not be overwritten. A warning regrading the same will be
# generated in the summary report and result log file. User would need to manually evaluate
# which config to persist
osgiFoldersToRename:
/apps/abc/config.author.dev1: config.author.dev
/apps/abc/config.author.dev2: config.author.dev
/apps/abc/config.author.localdev: config.author.dev
/apps/abc/config.prod: config.publish.prod
/apps/abc/config.publish: config.publish.prod
The tool has some known limitations (we are working on fixing them) such as :
uber-jar
dependencies with aem-sdk-api
dependencies.all/pom.xml
.nonadobedependencies
directory which will serve as a local repository.Contributions are welcomed! Refer to Contributing Guide for more information.
This project is licensed under the Apache V2 License. Refer to LICENSE for more information.
FAQs
AEM as a Cloud Service Project Restructuring tool
The npm package @adobe/aem-cs-source-migration-repository-modernizer receives a total of 1 weekly downloads. As such, @adobe/aem-cs-source-migration-repository-modernizer popularity was classified as not popular.
We found that @adobe/aem-cs-source-migration-repository-modernizer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 19 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.