Prev Next

Prerequisites


Before you start any of the tutorials you must prepare your environment so that the right tools are installed. This page helps you to achieve this.

Required Tools

We need to run the following tools on your computer - without them you won’t get very far at all.

  • Java, probably already got it? If not, this is a good time to get started! BRAIN-IoT targets Java 8 as a minimum version.
  • Maven, a popular build tool for Java applications with an enormous repository behind it. Ensure that you’re on at least version 3.5.4.
  • Git, IDEs usually include git support, but when it comes to git nothing really beats the good old command line.
  • Bnd, is the Swiss army knife of OSGi, it runs inside Maven, Eclipse & other tools, but we also need to use it on the command line.

Installing bnd command

If you’re using MacOS, then you can install bnd using brew.

Otherwise, you need to download the latest bnd.jar and run bnd command as executable jar:

$ java -jar biz.aQute.bnd-{VERSION}.jar <command>

To make this a little easier, you can create a bnd shell script:

#!/bin/sh
exec java -jar $(dirname $0)/biz.aQute.bnd-5.1.2.jar "$@"

Then make this script executable and move it and the bnd jar to a directory on your PATH:

$ chmod +x bnd
$ mv bnd biz.aQute.bnd-5.1.2.jar ~/bin

Now test it works:

$ bnd version
5.1.2.202007211702

Project Setup for private repositories

The BRAIN-IoT git and nexus repositories are currently private, so you need credentials to access them.

Ensure the following BRAIN-IoT nexus servers are configured in your ~/.m2/settings.xml:

<settings>
  <servers>
    <server>
      <id>brain-iot-releases</id>
      <username>${env.NEXUS_USER}</username>
      <password>${env.NEXUS_PASSWORD}</password>
    </server>
    <server>
      <id>brain-iot-snapshots</id>
      <username>${env.NEXUS_USER}</username>
      <password>${env.NEXUS_PASSWORD}</password>
    </server>
    <server>
      <id>brain-iot-nexus-marketplace</id>
      <username>${env.NEXUS_USER}</username>
      <password>${env.NEXUS_PASSWORD}</password>
    </server>
  </servers>
</settings>

You also need to set your credentials in the NEXUS_USER and NEXUS_PASSWORD environment variables.