Skip to main content

How-To: Use an existing Spring Boot application in the Workbench

๐ŸŽฏcontext

You already have an existing Spring Boot application which you want to transform to a IBM DevOps Solutions Workbench Project to use the benefits of the Workbench.

Descriptionโ€‹

In this How-To you will find the steps that are needed to embed your existing Spring Boot application into IBM DevOps Solutions Workbench by creating a new Workbench project and moving the implementation files to it.
For this use case the stack "Generic Service Java" is recommended.

โ„น๏ธnote

Please note that the links to the workbench tools in this tutorial only apply to the IBM Education Environment we provide. If you are using a different environment, e.g. your own installation, you will need to navigate directly to the required tools.

Preconditionsโ€‹

  • You are fine with Spring Boot (spring-boot-starter-parent) version 2.4.6 as parent.
  • You are using Maven as build automation tool.

Stepsโ€‹

Get ready for Java Generic Service developmentโ€‹

  1. Before we start with the project, please have a look into the Product Documentation - Stack Java Spring Boot to learn about the prerequisites that are necessary for Java Generic Service development.

  2. Now please download and install the Maven dependencies that are described here.

Create a new projectโ€‹

  1. Open the Solution Designer and create a new project of type "Generic Service Project (Java Spring Boot)".

  2. Open the new project and create a new pipeline in the CI / CD area. Dependent on your use case please define either a Deploy pipeline or a Release pipeline. Please check the Product Documentation for further information if needed.

  3. After this, please clone the new project repository using Git. You can use the URL of the source code repository in the "Git" panel at the bottom of the Solution Designer.

  4. When you open the cloned project, you can find some pre-generated files in the src folder. Please go through the stubs and delete the ones that are not needed for your use case.

  5. Merge the content of your application.yaml file into the pre-generated one.

  6. Merge the content of your pom.xml file into the pre-generated one. Be aware, that further adoptions might be needed, if you have to use another parent. The default parent has spring-boot-starter-parent in version 2.4.6 as its parent.

Potentially needed adoptionsโ€‹

Depending on your use case, some further adoptions might be helpful for you.

Provide private maven artifactsโ€‹

If your project is relying on private maven artifacts, then you have to add access to your private maven repository, see here for further details.

Provide additional certificatesโ€‹

If your project is accessing ressources with not yet trusted certificates, then they can be easily added - see here. IBM DevOps Solutions Workbench takes care, that they're present in the JVM during runtime.

Base URL of REST APIsโ€‹

If you are providing a REST API, then the base URL must start with the project acronym.

Use the Workbench Kafka clusterโ€‹

Easy: Use the generated EventService class. You just have to bring in your topic name. Alternatively, use the EventService as example and use the KafkaTemplate and the KafkaTopicsHelper in your code.

Known limitationsโ€‹

  • Sending and consuming Kafka events of other 'native' IBM DevOps Solutions Workbench solutions is not possible, yet.