Developer: Build SESAR REST API package using Spring Tool Suite 4 - GeoSamples/sesar-rest-api GitHub Wiki

Preparation:

  1. You should have downloaded the sesar-rest-api source code. See Here.
  2. You should have installed Docker Engine.
  3. You should have VPN installed.

Install Spring Tool Suite 4 on your local machine.

See the link below below to download and install the STS4. I had Spring Tool Suite version: 4.8.1.RELEASE. installed.

https://spring.io/tools

Create a STS4 project using existing maven file (pom.xml) file

Click File, then click 'Import'

Click File, then 'Import'

It will open up an window below, then click 'Existing Maven Projects'

click 'Existing Maven Project'

It will open up another window below, then click 'Browse' and enter the source code directory, check the checkbox next to pom.xml file, then click the finish.

browse the source code.

Then a project will be created and you can see it in 'Package Explorer'.

project-list

Create application.properties file in src/main/resources. If the 'resources' directory does not exist yet, you need to create it.

cd src/main/resources;
vi application.properties

Add the following to this file

spring.datasource.url= jdbc:postgresql://dbserver-name:db-port/db-name
spring.datasource.username=login
spring.datasource.password=password
# JPA settings
spring.jpa.hibernate.ddl-auto=validate
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true

Replace the database information and credentials in the above file.

Refresh the 'sesar-rest-api' project in 'Package Explorer'. You will see the application.properties .

application.properties

Login to Lamont VPN because the program will connect to the SESAR database located at the Lamont database server. Start the Docker Engine on the build machine. It will be used to build the docker image.
Click 'maven install' to build the whole package including the container. See the image below. 'maven install' will build sesar-rest-api.version.war file and earthchemdocker/sesar-rest-api:version docker image.

maven install

If you receive the following error:

Caused by: com.spotify.docker.client.exceptions.DockerException: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: com.spotify.docker.client.shaded.org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: no further information

You need to check the Expose daemon on tcp://localhost:2375 without TLS option in Docker Engine

From the console window, you will see it built successfully.

build success