Development environment guide with Intellij and Kubernetes


#1

Please follow these steps in case you want to setup your development environment using IntelliJ and Kubernetes
Let us know in case you need additional help.

1. Get and install IntelliJ

Download the installer from https://www.jetbrains.com/idea/download/ .
Note: This guide is for the ultimate edition but with some exceptions it might work with the community edition as well.
The ultimate edition has some additional features for web application. E.g: autodetects spring and JEE applications and docker configurations , you can setup data sources for databases, and is also helpful for javascript.

2. Install Lombok

Please go to https://projectlombok.org/setup/intellij and install lombok

Edit your maven settings.xml file

Set up settings.xml from
http://docs.metasfresh.org/developers_collection/en/getting_started_maven_settings

You can copy the file to .m2 folder or any other place but make sure it’s set as it should be in
File->Settings

3. Clone and import the code

Go to VCS->Git->Clone and clone the following repos into a parent directory:

4. Build

All pom files will be detected, so you can clean install whatever is needed

5. Start metasfresh

All spring boot configurations will be detected so you will see the following:

  • Please make sure you use -Xmx4096M VM option before running.

  • Optional: If you want to use kubernetes and use windows , install “docker for desktop” from
    https://hub.docker.com/editions/community/docker-ce-desktop-windows

  • make sure kubernetes is enabled in the settings

  • go to metasfresh-dist->dist->src->main->kubernetes->manifests->dev

  • create the services and deployments described in the yaml files. Check
    https://kubernetes.io/docs/reference/kubectl/cheatsheet/ for help

  • After everything is deployed with kubernetes, copy the application.properties files from
    “metasfresh-dev” into the structures and run “WebRestApiApplication from IntelliJ

  • Check http://localhost:30080/ for the metasfresh UI

  • Optional: There are some eclipse launcher files in the project. You could install eclipser and
    convert the files. After installing and restarting you can right click on a “.launch” file and you’ll
    find the “convert with eclipser” option.

6.Eclipse to IntelliJ hints

  • In general A workspace in eclipse is a project in intelliJ and a project in eclipse is a module in intelliJ

  • You can import eclipse shortcuts into Intellij. Go to File->Settings->KeyMap

  • Import eclipse formatting. Go to File->Settings->Editor->Code Style and after clicking the scheme settings drop down you can import a file. Go the metasfresh-dev->eclipse-config->eclipse-metas-formatter.xml


#2

Just a week and will test this for myself :blush:


#3

I just saw a message where intelliJ recommended me to enable annotation processing and guided me to this setting:

@Hanelore I now activated it…did that make sense?
I’m not yet sure which parts of the compiling are really done by “native” maven (I guess there, the lombok related processing is on as per pom.xml) and where a setting like this one makes a difference (Note: I didn’t yet get to try and run anything from IntelliJ)