New KOBI documentation is available: https://adeo-ccdp.gitbook.io/kobi/

Kobi Java Starters Migration from 2.6 to 2.7.2

Features

  • Remove the dependence from Kobi Parent Project in the pom.xml file
  • Java 11 Compliant and backward compatibility with Java 8
  • SpringBoot 2.2.13 Compliant
  • Static Resource Order for application registration

See the changelogs

Steps to migrate your project in Java 11

The Kobi-starters are build in Java 8 with JDK-11.

Prerequisites :

  • openJDK-11
  • JRE-11

You can keep your project in Java 8 (maven configuration), but we recommend you to migrate.

To migrate your project in Java 11, please follow these instructions.

Maven configuration

In the pom.xml file, update :

  • the version of kobi-starters to 2.7.2
  • the java property <java.version>11</java.version>
1
2
3
4
<properties>
   <java.version>11</java.version>
   <kobi.version>2.7.2</kobi.version>
</properties>
  • the version of maven-compiler-plugin to 3.8.1 or higher, and add the <release> configuration tag (ignore this step for Adeo organization and see below)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>${maven-compiler-plugin.version}</version>
    <configuration>
        <release>${jdk.version}</release>
        <includes>
            <include>**/*.java</include>
        </includes>
        <fork>true</fork>
        <encoding>${project.build.sourceEncoding}</encoding>
        <compilerArgs>
            <arg>-verbose</arg>
            <arg>-parameters</arg>
        </compilerArgs>
    </configuration>
</plugin>

The maven build configuration is set in Adeo parent POM by default.
You can inherited from this last, instead of configure your own maven build configuration (like maven-compiler-plugin) :

1
2
3
4
5
<parent>
    <groupId>com.adeo.pom</groupId>
    <artifactId>parent</artifactId>
    <version>2.0.0</version>
</parent>
The Kobi Starter use SpringBoot 2.2.13 by default. Thanks to check if you override this version in your project to benefit it.

Containerization

Update the Dockerfile file to build an image with JDK 11+ and Node.

You can use this Adeo docker image :

1
FROM adeo-docker-public.jfrog.io/dockerfiles-collection/openjdk-jar-runner-datadog-agent:11.0.9-jre-slim-buster

CI/CD

Your CI/CD have to build in Java 11.

In your .gitlab-ci.yml file, add the next variable :

1
2
variables:
  MAVEN_JDK_IMAGE: maven-node:3.6-jdk-11-node-slim

Best practices

Please, remove or replace the deprecated Java options and make sure to use the G1 Garbage Collector (by default since Java 9) while checking your deployment/environment configuration.

Troubleshooting

The dependency org.codehaus.janino:janino version must be 3.1.2 or higher.
You can remove it too if you use Spring profiles in logback.xml.

The versions kobi-starters:2.7.0 and kobi-starters:2.7.1 are deprecated.