Java-Based App on SCP: Part2-ESPM Application

In this part, we are going to download and run the ESPM application.
Note: If you don’t want to build ESPM application locally then you can download WAR file here and skip to Deploy section.
Clone Repository
- Open Git Perspective (Go to Windows
- Input URI
https://github.com/SAP/cloud-espm-v2.git
and the fields will be automatically populated. - Input your username and password
- Select Store in Secure Store if you don’t want to input the password again.
- Select all branches and click Next.
- Select Destination Directory and click Finish.
Now, you should see local repository on branch master while there are several on remote.

Setup Maven
- In Eclipse, go to Preferences → Maven → User Settings.
- Check if the file settings.xml is created under .m2 folder. If not, create it with this content:
<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: Remove <proxies> part if you’re note behind a proxy.
Import Maven Projects
- Swtich to Java EE perspective.
- Go to File → Import… and select Maven → Existing Maven Projects.
- Choose the directory of your ESPM application and click Next.
- Click Finish.

Update Maven Projects
- Select all three Maven projects.
- Right-click and select Maven → Update Project…

Build Maven Project
- Right-click at cloud-espm-v2 project and select Run As → 2 Maven build…
- Input
clean install
in Goals. - Click Run.
- Maven will start building and downloading all dependencies. This may take some time.

5. When the build is completed successfully, you should see this message:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] espm ............................................... SUCCESS [ 2.440 s]
[INFO] espm-cloud-jpa ..................................... SUCCESS [ 58.834 s]
[INFO] espm-cloud-web ..................................... SUCCESS [02:19 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:21 min
[INFO] Finished at: 2017-05-11T16:20:29+07:00
[INFO] Final Memory: 28M/120M
[INFO] ------------------------------------------------------------------------
Note: Maven requires Java Development Kit (JDK), you can install from here. Otherwise, the build will fail.
Deploy the Application on SCP
Note: If you didn’t have the WAR file then you can download it from here
- Log on SCP Cockpit and go to Applications → Java Applications.
- Click Deploy Application.
- Select WAR file in deploy subfolder under the project folder.
- Input the following:
Application Name: espm
Runtime Name: Java Web Tomcat 8
JVM Version: JRE 8 - Click Deploy.

6. After deploy is completed, click Start.
7. Open the application URL and you should see the Customers web frontend.

Assign Retailer Role
- In espm application cockpit, go to Security → Roles.
- Add your ID to Retailer role.
- Open the Retailer web frontend by replacing /webshop/ with /retailer/ in the URL.

Run the Application
- Open customer front-end application, select a product and place the order.
- Open retailer front-end application, approve or reject the order.
- Use retailer front-end application to adjust the Minimum Stock Level > Items in Stock to change status of the product.
- The application uses HANA database.
