Initial project bootstrap
Download the latest SAP Commerce 2011 release zip file and put it into the
dependencies
folder using the correct file name, e.g.cp ~/Downloads/CXCOMM201100P*.ZIP ./dependencies/hybris-commerce-suite-2011.6.zipOr configure your S-User (e.g. using
gradle.properties
) and run./gradlew downloadAndVerifyPlatform
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> \ -PintExtPackVersion=2102.1 # (optional) enable "SAP Commerce Cloud, Integration Extension Pack"Read the output!
(If you use a headless setup: You can delete the generated
<projectName>storefront
extension afterwards. Don't forget to remove it fromlocalextensions.xml
/manifest.jsonnet
too)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 anymore:
rm -r bootstrap*
Delete this quote
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