Skip to content

Development Note

zero edited this page Jan 24, 2019 · 38 revisions

Setup development environment

Prerequisites

  • Java 8

  • Gradle: Build Tool

    • The project is compatible with Gradle 4.10.x, then you should install the right version here
    • If your computer already installed Gradle 5.x.x, use gradlew/gradlew.bat instead (in the root directory of project). For example:
      gradlew.bat --version
      
  • Docker

IDE

Intellij

  • Java 8

    • From Project panel, click on root item and press F4
    • Normally, java 1.8 will be available in Project SDK under Project session.

    java8_1

    • If it is not available, click on New -> JDK
    • Browser to your JDK8 installation folder
    • Click OK to save your changes

    java8

  • Gradle

    • From Intellij menu, open File -> Settings
    • From left panel search box, input 'gradle'
    • Select Gradle session under Build, Execution, Deployment -> Build Tools
    • From right panel, check on the Use gradle 'wrapper' task configuration then press OK

    gradle

  • Importing code style

    • Download and unzip the templates from here
    • From Intellij menu, open File -> Settings, select Editor -> Code Style session
    • From right panel, click to settings icon, select Import Scheme -> Intellij IDEA code style XML

    codestyle1

    • Browser to your code style downloaded above, select java-intellij-zero-style.xml then Ok.

    codestyle2

    • The ZeroStyle scheme will be available and selected by default.

    codestyle3

    • Click OK to close Setting panel and apply your changes.
  • Install Intellij lombok plugin

    • From Intellij menu, open File -> Settings, select Plugins session
    • Open Marketplace tab, from the plugins search box (right panel), input 'lombok' then Enter
    • From the search result, Lombok plugin will be availabe, click on Install button
  • Enable Annoation processing

    • From Intellij menu, open File -> Settings, select Build, Execution, Deployment -> Compiler -> Annotation Processors
    • From the right panel, check on Enable annotation processing then press OK

    annotation

Eclipse

TBD

Docker

Get Started

Required

  • Prerequisites
  • Docker is desirable. Refers useful startup scripts
  • Create nexus.secret.properties with content:
    nexusSnapshotUrl=http://<your-nexus-server>/repository/maven-snapshots/
    nexusReleaseURL=http://<your-nexus-server>/repository/maven-releases/
    nexusUsername=<your-nexus-user>
    nexusPassword=<your-nexus-password>

Build

  • Build local: compile and build to jar file, then push artifact to local maven repository.

    gradle clean jooq build uberJar
  • Publish artifacts to Nexus server:

    gradle publish

Run Demo

  • Copy theses artifacts to demo folder: (will be removed when I standardize build and bundle script)

    cp -rf build/libs/nube-dashboard-connector-edge-1.0.0-SNAPSHOT-fat.jar demo/bios-connector.jar
    cp -rf build/libs/nube-edge-bios-1.0.0-SNAPSHOT-fat.jar demo/bios.jar
    cp -rf build/libs/nube-dashboard-server-1.0.0-SNAPSHOT-fat.jar demo/dashboard.jar
    cp -rf dashboard/server/webroot demo/
  • Start services (replace ${your-ip})

    java -Dlogback.configurationFile=logback-bios-connector.xml -jar bios-connector.jar -conf bios-connector.json
    
    java -Dlogback.configurationFile=logback-bios.xml -jar bios.jar -conf bios.json
    
    java -Dlogback.configurationFile=logback-dashboard.xml -jar dashboard.jar -conf dashboard.json

Interact REST API

Will be part of Swagger UI soon. Try Postman version first.

Clone this wiki locally