Local system setup for SAP Commerce Hybris 2105 version with the use of Spartacus

 

SAP Commerce Cloud 2105 installation for Spartacus

Before I begin the blog, I would like to provide a brief overview of what Spartacus is and why we're using it.

Spartacus:

·         It is an angular JS application for storefront development, which interacts with the Hybris backend applications using REST API calls.

  • It is only for SAP Hybris Commerce / SAP Commerce Cloud. 

Step 1: The creation of a new recipe

Create a folder called Hybris-2105-Spartacus in your D drive or any drive, which you want.


Installation links:

  • Download and unzip the following.

1.      SAP Commerce Cloud 2105 from the below link

https://accounts.sap.com/saml2/idp/sso

  •         Please see the link below for Spartacus- sample data.

Direct link to spartacussampledata.2105.zip


  • By clicking on the links, it will redirect to the login page. Provide s user-id and password to log in.










username: Your s user-id

password: Your password

  • After downloading the commerce2105 zip file, place that within the Hybris-2105-Spartacus folder and unzip it.



  • Do direct extract here for the cx folder. Then you're able to see like below, after extraction.

  • Now, copy the sample data from your downloads to the Hybris-2105-Spartacus folder and unzip it.

  • Move the custom.properties file from location one to location two.

Location1:


Location2:

  • After moving, you’re able to see like below:

  • Now rename the spartacussampledata.2105 to spartacussampledata


  • Now, go to the path: hybris/bin.

  • Create a folder referred to as custom inside hybris/bin.

  • Move the whole spartacussampledata to the custom folder.


  • Now, go to the installer/recipes folder and duplicate the cx folder.


  • And rename the duplicate cx folder, i.e., cx-Copy to cx-for-spa

  • Uncomment the extension name in the build file, which is a Gradle source file located in the cx-for-spa directory.




  • Save and close the file.

Step 2: New recipe building and Initialization

  • Go to the below location and open the command prompt.


  • Set up a recipe using the below command

         install.bat –r cx-for-spa

        Click on enter


  • After running the above command, you will get a build success.

  • Do setantenv.bat and then do ant clean all by going to platform path.
  • Now, do initialize the system by running the below command.
  •         install.bat -r cx-for-spa initialize



  • This process took some time.
  • When initialization is complete, a build success message appears.

  •  Now start the SAP Commerce Cloud by using the below command. It took a few more minutes to start.

        install.bat –r cx-for-spa start

        Once the server is up, check the below URLs.

        https://localhost:9002

    https://localhost:9002/backoffice

    https://localhost:9002/yacceleratorstorefront/?site=electronics

  • In the back office, check to see if the Spartacus version of the sample data has been created.
  • Login to Backoffice-WCMS Website

Username: admin

Password: Nimda (Letter N should be in small letter n).

    Step 3: Import OCC credentials

  • Spartacus uses OCC REST API calls to urge info from and create changes to the backend. For this, the backend should be organized with bound credentials.
  • Open the admin page and head to Console- Impex Import.


  • Paste the following code and click on import content.
  • You can find the code at point 3 in the below link.


  • Once the import is complete, use the curl command in a terminal or command prompt window to confirm that the OAuth client has been defined successfully.
  • Open a new command prompt and paste the below:


  • Using the client ID and password you added to the back end, the curl program performs a POST request for an access token. The command should provide a result that looks like this:

  • So, we are done with installing the SAP Commerce Cloud by using Spartacus.
  • We will see building the Spartacus Storefront from libraries in the next blog.

Note:

If you face an error associated with the java version



Sol: Need to change the java home in path variables to jdk11.

  • Now, do initialize the system by running the below command.

        install.bat -r cx-for-spa initialize

  • If you encounter a haul like a build failed exception for semantic analysis, which is like the below screen:


Comment out the build.parallel=true line in the local.properties file.

Path: D:\Hybris-2105-Spartacus\hybris\config\local.properties


  • Run the initialize command.


Comments