Managing Custom Code Solutions

Within a Custom Code Solution there is no possibility of modeling. Once you have implemented the solution it is possible to export it in the local marketplace. In order to get started with the implementation you have to make sure that the prerequisites are met and proceed the following steps.

Prerequisites

Java SDK

A java 8 SDK is needed to develop Custom Implementation Java based solutions.

Please download either the Oracle 8 JDK from https://www.oracle.com/technetwork/java/javaee/downloads/index.html or the Open JDK from https://openjdk.java.net/ and follow the installation instructions of the JDK.

Maven

Maven Version >=3.6.1 is required to develop Custom Implementation Java based solutions.

Please download and install maven from https://maven.apache.org

Eclipse

You can develop Custom Implementation Java based solutions in the IDE of your choice.

We recommend using eclipse in the latest version which can be downloaded from: https://www.eclipse.org/downloads/

Eclipse Plugins

We recommend installing the following Eclipse Plugins and utilities

Download dependencies for development of java solutions

In order to build and run custom java solutions, some Solution Envoy dependencies are required that come with many already configured tools

Open the Solution Envoy dashboard (e.g. http://myproject.apps.openshift.mycluster.cloud). Navigate to Infrastructuretab, click and download all the dependencies listed under Maven Dependencies

Install dependencies

Dependencies downloaded are required to be installed in the local maven repository. Here is an example how the dependencies can be installed via maven.

mvn install:install-file -Dfile=cp-framework-sdk-autoconfiguration-1.0.103966.jar -DpomFile=cp-framework-sdk-autoconfiguration-1.0.103966.pom
mvn install:install-file -Dfile=cp-framework-sdk-parent-1.0.103966.pom -DpomFile=cp-framework-sdk-parent-1.0.103966.pom

Running/building custom java solutions using the dependencies

Create custom implementation solution

Open Solution Designer and create new solution via clicking on Create button, fill the solution specific details but from Type drop-down make sure to select Custom Implementation Solution and Implementation Language as Java

Clone git project to the system

In order to build and run the solution, the git project should be cloned to user's workspace. In order to checkout a Custom Code Solution open the Solution after the creation and navigate to GIT tab and copy the Git Source Repository URI.

Alter the URL and add the git user so it looks like the following:

Before:

https://auto-devops-url/managed-solutions/SOLJAVA.git

After:

https://git@auto-devops-url/managed-solutions/SOLJAVA.git

Open a Terminal and clone the solution. You will be prompted for a password. Please use your personal access token as password:

git clone https://git@auto-devops-url/managed-solutions/SOLJAVA.git

Remember: In order to be able to interact with the git repository you have to provide the credentials for your git system.

Unit Tests for custom solutions

It's highly recommended to write unit tests for your Java solutions. The unit tests will be executed during the solution pipeline execution as part of the maven build.