Initial project bootstrap
Download the latest SAP Commerce 2211 release zip file and put it into the
dependencies
folder using the correct file name, e.g.cp ~/Downloads/CXCOMCL221100U_23*.ZIP ./dependencies/hybris-commerce-suite-2211.23.zipOr configure your S-User (e.g. using
gradle.properties
) and run./gradlew downloadAndVerifyPlatform
Repeat the same for Integration extension pack if you want to use it.
Download the cloudhotfolders ZIP into the
dependencies
folder (save ascloudhotfolders-2211.zip
). If you don't need cloudhotfolders locally you can also remove them from thebuild.gradle.kts
and the generatedlocalextensions.xml
after the next step.Bootstrap the starting point for your Commerce project by running the following command:
./gradlew -b bootstrap.gradle.kts \ -PprojectName=<name, e.g. coolshop> \ -ProotPackage=<package, e.g. com.cool.shop>Read the output!
The following optional settings are available:
-PintExtPackVersion=2102.1
enable "SAP Commerce Cloud, Integration Extension Pack" with version.-PsolrVersion=9.2
set the solr version for the manifest. To check which versions are supported, see Third-Party compatibility of the Update Release Notes of your selected version.-PaccStorefrontEnabled
enable code generation for the deprecated accelerator storefront.Review the generated configuration in
hybris/config
, especially thehybris/config/environment/*.properties
files andlocalextensions.xml
(search forTODO:
comments)Update the
manifest.jsonnet
(again, search forTODO:
comments).
You can use the jsonnet file to update themanifest.json
for your project.Delete all bootstrap files, you don't need them any more:
rm -r bootstrap*
Delete this quote and the demo-section at the bottom of this README
Commit and push the changes to your project repository :)
We use Gradle + commerce-gradle-plugin to automate whole project setup.
git clone <project>
cd <project>
docker-compose up -d
cd core-customize
./gradlew setupLocalDevelopment
./gradlew yclean yall
./gradlew yinitialize
To generate the manifest.json
with Jsonnet:
jsonnet --output-file manifest.json manifest.jsonnet
- Add the addon to the
manifest.json
(either by hand or viamanifest.jsonnet
, documentation) - Run
./gradlew installManifestAddon
- Reformat
<storefront>/extensioninfo.xml
(unfortunately, the the platform build messes it up when adding addons) - Commit/push your changes
- Tell your team to run
./gradlew installManifestAddon
after pulling your changes.
By combining the configuration reuse mechanism of CCv2, the optional configuration folder of Commerce and a bit of clever symlinking of files and folders, we can use the same configuration locally and in the cloud.
This setup uses:
hybris/config/localextensions.xml
to configure extensionshybris/config/cloud/**/*.properties
to configure properties per CCv2 aspect and/or persona. There is one file per aspect, plus the special filelocal-dev.properties
that configures the local development environment.hybris/config/local-config
is configured ashybris.optional.config.dir
and contains symlinks to the relevant property files inhybris/config/cloud
(by default:common.properties
,persona/development.properties
andlocal-dev.properties
).
Importantlocal.properties
must not be modified at all (that's why it is in.gitignore
).- If you have any configuration specific to your local machine, put it in
hybris/config/local-config/99-local.properties
. - If the local setup changes for the whole project, update
hybris/config/cloud/local-dev.properties
- If you have any configuration specific to your local machine, put it in
- If you enabled solr customization during bootstrap (
./gradle -b boostrap.gradle.kts enableSolrCustomization
), the default cloud solr configuration set is moved to the correct folder structure for CCv2 (documentation). A symlink inhybris/config/solr
allows you to use the same configuration locally.
core-customize
├── ...
├── hybris
├── ...
│ ├── config
│ │ ├── cloud
+--------------------> accstorefront.properties
+--------------------> admin.properties
+--------------------> api.properties
+--------------------> backgroundprocessing.properties
+--------------------> backoffice.properties
+--------------------> common.properties <---+
| │ │ │ └── local-dev.properties <--+ |
| │ │ ├── ... | | symlinks
| │ │ ├── local-config | |
manifest.json | │ │ │ ├── 10-local.properties +-----+
useConfig | │ │ │ ├── 50-local.properties +---+
properties | │ │ │ └── 99-local.properties
... +-------------+ │ │ ├── local.properties
extensions +--------------------------> localextensions.xml
solr +---------+ │ │ ├── readme.txt
| │ │ ├── solr
| │ │ │ └── instances
| │ │ │ └── cloud
| │ │ │ ├── configsets +-------+
| │ │ │ ├── ... |
| │ │ │ └── zoo.cfg |
| │ │ └── ... |
| ├── ... | symlink
+----------------> solr |
│ └── server |
│ └── solr |
│ └── configsets <-------------+
│ └── default
│ └── conf
│ ├── lang
│ ├── protwords.txt
│ ├── schema.xml
│ ├── solrconfig.xml
│ ├── stopwords.txt
│ └── synonyms.txt
└── ...
The file bootstrap-demo.gradle.kts
bootstraps a demo storefront based on the cx
recipe,
including the spartacussampledata
extension (necessary to demo the Spartacus storefront; documentation)
To generate the demo, run:
./gradlew -b bootstrap-demo.gradle.kts