How to compile and execute Control Panel of the Platform from Eclipse?

This guide shows how to compile the platform sources and run the Platform Control Panel from Eclipse.


Step 1: Download Platform code

In this step, you will download the Platform code from the Github repository.

  1. If you do not have it, install git (Use this guide: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
  2. When installed, execute >git config --list
  3. (Only need for internal repositories with autogenerated certificate: If you do not have the property http.sslverify=false, then you have to create it with: git config --global http.sslverify false)
  4. Also, add this property: git config --global core.longpaths true
  5. Also, configure your name and email:
    git config --global user.name "my_name"
    git config --global user.email "my_mail"
  6. If you are behind a proxy, you have to configure it. Use:
    git config --global http.proxy http://<user>:<password>@<host_proxy>:<port_proxy>
  7. Clon the repository of the platform with >git clone https://github.com/onesaitplatform/onesaitplatform-cloud.git (This creates the directory /onesait-cloud-platform/ with the master branch of the platform repository).
    You will see something like this:

Step 2: Compile the sources with Maven to generate the artifacts (.jar)

In this step we are going to compile the sources of the platform.

(NOTE: We use Java 8 to compile)

  1. If you don´t have it, install Java (for compatibility with our clients we use Java 8 for compile). You can download from Java Oracle or from OpenJDK site.
  2. If you don´t have it, install Maven (Use this guide: https://maven.apache.org/install.html). (And remember to configure Proxy if you are using one at %MAVEN_HOME%/conf/settings.xml)
  3. From the folder where you clone the platform (onesait-cloud-platform), go to the directory /sources to compile the sources of the platform. Execute: >mvn clean install -Dmaven.test.skip=true (In this step we can skip the tests). 

         First time compilation can take several minutes because you need to download all the dependencies:

Finally you will get this as the result:

Step 3: Execute Persistence Services (ConfigDB and RealTimeDB)

In order for the Platform Control Panel to function, it is only necessary to have the ConfigDB (where the configurations are stored) and the RealTimeDB (where the data managed by the platform are stored). The rest of the modules can be started when necessary.

In this step start the ConfigDB and the RealTimeDB, also called the persistence-services platform. For this, the simplest thing is to follow the guide /wiki/spaces/PT/pages/43712636 and go to step 3 (if you want the data to persist, you must use the Docker Compose docker-compose.persistent file.yml).

With this you will have these repositories launched and running.

Step 4: Launch Control Panel from Eclipse IDE

Next you will configure your Eclipse so that it can execute the Control Panel of the Platform and then to execute the Control Panel from this Eclipse.

  1. If you do not have it yet, download a version of Eclipse JEE, since the platform is based on the Spring ecosystem from Platform. We recommend using Spring Tool Suite (STS), which offers an integration with its entire ecosystem. You can download the version for your operating system from https://spring.io/tools3/sts/all
  2. The platform uses Lombok (Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java), which implies that you must configure our Eclipse to load a Java agent. This can be done by having a boot script of this type: -javaagent: lombok.jar or indicating it in eclipse.ini or STS.in

Important: Also remember that the platform uses Java 8 to compile and execute (for compatibility), so it will be necessary to have a JDK 8 configured in our Eclipse).

3.  Once configured Lombok, you can start your IDE (with Eclipse.exe or STS.exe in this case).

4. Once Eclipse is started, import the project. To do that, go to File> Import> Maven> Existing Maven Projects> and select the Control Panel project (you can find it in the folder \onesaitplatform-cloud\sources\ downloaded when cloning Github). Inside you will make sure to only select the parent project and the modules\control-panel project

After a while when the dependencies will be updated and the project will be compiled,

I will have something like this:

You can deactivate this option if we do not want to install the plugin in charge of updating the licenses in Eclipse:


5. As you are running the persistence services on containers, you need to make a small change, since the scheduler_db is mapped to another port. For that, in the application.yml file:

you need to edit this line:

with this change:

    url: jdbc:mysql://localhost:3307/onesaitplatform_scheduler?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=false&autoReconnect=true


6. Now you only have to run the Control Panel. For that, within the Eclipse project, look for the ControlPanelWebApplication class and with the right button select Debug As> Java Application.

After some seconds, when you see on the console that app is started you can access Control Panel at http://localhost:18000. You can access Control Panel with these users:

  • administrator/Community2019!
  • developer/Community2019!
  • analytics/Community2019!

Â