Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Latest commit

 

History

History
101 lines (73 loc) · 5.69 KB

File metadata and controls

101 lines (73 loc) · 5.69 KB

Prerequisites

Table of Contents

Local Setup

In case you like to run the example locally, you need to prepare your local system environment. Like the sample code this comes with no warranty and we can not provide support here. For further details see also LICENSE file.

Java 8 JDK

  • Install the latest version of the Java JDK on your machine (at least Java 8).
  • Windows:
    • Run the console cmd and enter setx JAVA_HOME "C:\Program Files\Java\jdk1.8.X" (replace the path with the path leading to your JDK installation)
    • To test your installation, open a new console and run both "%JAVA_HOME%\bin\java" -version and java -version. Both should return "java version 1.8.X".
  • MacOSX: nothing to do, env variables should be adjusted automatically.

Maven

The builds of the individual microservices are managed using Apache Maven.

Install and configure Maven as documented here.

To test your installation, open a new console and run mvn --version.

Eclipse IDE

An integrated development environment (IDE) is useful for development and experimenting with the code. We recommend to use Eclipse as the following descriptions are tailored for it.

  • Eclipse IDE
    • Download Eclipse (select Eclipse IDE for Java EE Developers)
    • Unpack the ZIP file to a suitable location on your computer, e.g. C:\dev\eclipse
  • Assign installed Java JRE to Eclipse: Window - Preferences, type jre in filter, in Installed JREs, select Add...->Standard VM and enter the path to your Java installation.
  • Optionally you can configure your proxies within Eclipse as explained here.

Note: the Community edition of IntelliJ IDEA is an alternative IDE.

Cloud Foundry Client

The developed microservices will run on the Cloud Foundry platform.

Docker

Docker is needed to conveniently start services like PostgreSQL on your local machine.

Download and install the latest Docker for Windows or Docker for Mac release. See the Getting Started documentation if you're not yet familiar with Docker.

In case you experience problems with the latest version, you can try to install older versions that are linked in the release notes: Windows, Mac.

Note: the docker installer automatically enables Hyper-V if you have not done so yet. This requires a restart that may take several minutes to complete.

Note: Hyper-V interferes with VirtualBox (Hyper-V must to be enabled for Docker, but this crashes VirtualBox)

To start all docker containers required for a sample module, execute docker-compose up -d in the directory of the module. This will run all containers as defined in the docker-compose.yml file located at the root of the module. To tear down all containers, execute docker-compose down.

Execute docker ps to view all running docker images.

Project Setup

Each module is a separate Java project in a separate folder as part of this Git repository.

Clone Git Repository

The project can be cloned using this the following URL: [email protected]:SAP/cloud-application-security-sample.git. Either use the command line and type git clone https://github.com/SAP/cloud-application-security-sample.git or use the Git perspective in Eclipse and choose Clone a Git Repository.

Note: In case SSH is not working make use of the HTTPS link when cloning the repository.

Import Maven project into Eclipse

Within Eclipse you need to import the source code.

  1. Select File - Import in the main menu
  2. Select Maven - Existing Maven Projects in the dialog
  3. Import the module you want to work on, e.g. spring-security-acl by selecting the respective directory and clicking OK
  4. Finally, update the Maven Settings of the project by presssing ALT+F5 and then OK.

REST API Testing Tools

  • Postman is a Chrome Plugin that helps to create and test custom HTTP requests.
  • You might need to install another Postman Interceptor Chrome Plugin, which will help you to send requests which uses browser cookies through the Postman app.