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.
- Install the latest version of the Java JDK on your machine (at least Java 8).
- Windows:
- Run the console
cmd
and entersetx 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
andjava -version
. Both should return "java version 1.8.X".
- Run the console
- MacOSX: nothing to do, env variables should be adjusted automatically.
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
.
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
, typejre
in filter, inInstalled JREs
, selectAdd...
->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.
The developed microservices will run on the Cloud Foundry platform.
- Install the Cloud Foundry Command Line Interface (CLI) following this guide.
- Create a account as explained in this tutorial: SAP Cloud Platform: Get a Free Trial Account in Cloud Foundry environment.
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.
Each module is a separate Java project in a separate folder as part of this 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.
Within Eclipse you need to import the source code.
- Select
File - Import
in the main menu - Select
Maven - Existing Maven Projects
in the dialog - Import the module you want to work on, e.g.
spring-security-acl
by selecting the respective directory and clickingOK
- Finally, update the Maven Settings of the project by presssing
ALT+F5
and thenOK
.
- 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 thePostman
app.