Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Navin_Krishnan
Advisor
Advisor
Installation , Build and Deployment Guide for ESPM Application

  • Setting up the developer environment

  • Build the application and Deploy


 

Setting up the developer environment


 

  1. Install Oracle Java SE Development Kit (JDK) 8 or SAP JVM 8. * 



 



 

  • After downloading Oracle Java SE Development Kit (JDK) 8,  Set Environment Variables JAVA_HOME and PATH



  1. Go to Control PanelSystem > Advanced System Settings

  2. Click the Environment Variables button

  3. Under System Variables, click New

  4. In the Variable Name field, enter path of the local location of JDK as JAVA_HOME (C:/Program Files/Java/jdk1.8.0.65 ) and another system variable ie. PATH of the bin folder of JDK as PATH (C:\Program Files\Java\jdk1.8.0_65\bin)


 

2. Eclipse Neon from official Eclipse website.



 

 

  • In the next window Click on 64 bit


 



 

 



 

3. Install SAP Development Tools for Eclipse.

  • Browse the local location of downloaded eclipse neon > Unzip eclipse-jee-neon-3-win32-x86_64.zip > Double Click on eclipse.exe > Create a workspace > Navigate to eclipse




  • Click on help menu > Install new software > Add




 



  • Select SAP Cloud Platform Tools checkbox > next > Agree the privacy agreement and complete the installation process




 

4. Install SAP Cloud Platform SDK

Go to (https://tools.hana.ondemand.com/#cloud) , download SAP Cloud platform SDK for JAVA Web Tomcat 8



 

5. Set up the Runtime Environment in Eclipse.

  • In the Eclipse IDE main menu > Window > Preferences

  • Choose > Server > Runtime Environments > Click on Add button

  • Select SAP  > Java Web Tomcat 8 > Next

  • Add your SDK directory:

    • If you have previously downloaded SDK for Java Web Tomcat 8 from Cloud Tools, choose the Browse button to locate your SDK folder.

    • If you have no SDK for Java Web Tomcat 8 locally available or need the latest version, choose the Download and Install button to download it directly from the Maven Central.

    • Click on Finish



  • Java Web Tomcat 8 is added as a server runtime environment.


 

6. Set JDK in Eclipse

  • In the Eclipse IDE main menu > Window > Preferences

  • Enter Installed JREs in the filter field in the top-left corner

  • In the Installed JREs Windows, select JDK as standard VM if it is available in the list of installed JREs, if not click on Add > Standard VM > Next




  • Browse the Directory path of the JDK to add as JRE Home > Finish




 

  • Now the JDK will be added to the list of JREs , select > Apply > Ok




 

7. Register for a free developer account on SAP Cloud Platform.



 

 

  • In the Registration Page, give all the required information and register successfully. If you are already registered then in the Login Page , give user id and password and login successfully.


 



 

 

Build the application and deploy


1.   Git configuration in Eclipse



  • From the Eclipse IDE main menu, choose Window > Preferences

  • Enter git in the filter field in the top-left corner

  • Navigate to Team > Git > Configuration and select the Configuration node and add the following configuration


 

 

 

Note! For most people the proxy value doesn’t need to be set but if you are working behind a proxy, then it should be set as per you environment.

  1. Maven configuration



  • From the Eclipse IDE main menu, choose Window > Preferences

  • Enter maven in the filter field in the top-left corner

  • Navigate to Maven > User Settings and select the User Settings node

    • If you have already installed Maven before you can click open file link. If you are using Maven for the first time you need to create a settings.xml file at the location /Users/your-user-name/.m2/settings.xml. The contents of the settings.xml file should look like the snippet below.




 

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>${user.home}/.m2/repository</localRepository>
<profiles>
<profile>
<id>development</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
</properties>
</profile>
</profiles>
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>proxy</host>
<port>8080</port>
</proxy>
</proxies>
</settings>

Note! For most people the proxy value doesn’t need to be set, you can remove the entire proxy section from the snippet, but if you are working behind a proxy, then it should be set as per you environment.

 

  1. Clone Git repository and import Maven project



  • Open https://github.com/SAP/cloud-espm-v2 in your web browser.

  • Click on the Copy to clipboard so that the Git repository URL of the opened GitHub repository is copied to your clipboard.




  • In Eclipse, open the Git perspective. From the Eclipse IDE main menu, choose Window > Open Perspective > Other... Select Git and choose Ok to open the Git perspective.


 



 

 



 

  • In this perspective you have the Git Repositories view on the left. As long as there is no Git Repository defined you will see 3 links (as shown here) to add a repository to the view.




  • In the corresponding menu (top-right of the view), click on the Clone a Git repository link.

  • Because you copied before the ESPM repository URL to your clipboard, the fields (URI, Host, Repository path and Protocol) of the opened dialog are filled automatically with the correct values.




  • Do not change anything, just click Next.

  • On this wizard page check that the master branch is selected and click again on Next.




  • On the last wizard page you can adjust the location of the local Git Repository, but for the scope of this tutorial we'll just leave the default as-is.




  • Click on Finish so that the remote ESPM repository (source code) is cloned to the local location specified on the last wizard page.


 



 

  • In Eclipse, open File->Import->Existing Maven projects






  • Browse the location where you have saved the ESPM project locally from git.


 

 

  

  1. Update dependencies and build Maven project


Right click on the web project in ESPM > and choose Maven > Click on Update Project



 

  • Note! If you face errors you need to modify the parent pom.xml for certain property values depending on your environment:




    • local.server.proxy.settings - delete this if you are not behind a proxy server, else update your proxy settings here

    • browser.proxy.settings - delete this if your browser is not using a proxy, else update your browser proxy settings here

    • sap.cloud.sdk.version - The SAP Cloud Platform SDK for Java Web Tomcat 8 version that you intend to run the application with, is version 3.20.3.1

    • olingo.version - The Apache Olingo version that you intend the application to run with, the minimum version supported is 2.0.7



The application can be built with the maven command to the parent pom.xml :
clean install

Or It can be build from eclipse , Right click on the root folder of ESPM project



Then type “clean install > Apply > Ok





After building the application update the Maven Project :

Right click on the web project in ESPM > and choose Maven > Click on Update Project

 

5. Deploy the application on local Cloud Runtime

i) Run the application in HCP Java Web Tomcat 8 Server

  • Right click on the web project in ESPM > and choose the Run on Server option




  • Make sure that Manually define a new server is selected and choose SAP > Java Web Tomcat 8 Server as server type. Leave all other settings unchanged and choose Finish


 



 

  • Now a local server is started that has your espm application deployed.


ii)Create Users and Assign Role

  • To enable local users to access the Retailer UI, you need to define user IDs in the local user store and assigned the role “Retailer” to this user.


Create a user with the below information
ID      Name    Password    Role

ret ret 123 Retailer

 




  1. Deploy the application on SAP HCP via the cockpit


Note! The application name must be "espm", else the above URL will change based on the application name given during deployment

  1. Login to https://account.hanatrial.ondemand.com

  2. Go to JAVA application




3.Click on “Deploy Application” tab



4.  Add War File Location, Give Application Name "espm" ,select Runtime Name "Java Web Tomcat 8" and JVM Version "JRE 8"



5.After Successful Deployment , Click on Start



 

  • Configure the application role assignments from the cockpit. You basically need to add the "Retailer" role to your SAP Cloud Platform and  user to access the Retailer UI, Go to Cockpit >  Java Application > click on espm application > click on roles > Assign retailer role to user.


 





 

You can access the application from the URL


    • The eCommerce site can be accessed via the URL: https://espm<account>.hanatrial.ondemand.com/espm-cloud-web/webshop

    • The Retailer UI can be accessed via the URL: https://espm<account>.hanatrial.ondemand.com/espm-cloud-web/retailer



Note! The application name must be "espm", else the above URL will change based on the application name given during deployment