Site icon LCDUNG

Development Environment Athenz

Development Tools

If you would like to build your own copy of Athenz rather than using the pre-built binary packages, then here is the list of development tools you need to have installed on your system.

Java Platform JDK 8

To build Athenz components, you must have Java Platform JDK 8 installed on your machine. The main authorization services – ZMS and ZTS, are written in Java and using embedded Jetty.

Oracle Java Platform JDK 8

Athenz has been developed and tested with Oracle Java Platform JDK 8. However, it should compile and run without any issues with OpenJDK 8 as well.

#Update your server
sudo apt-get update -y
sudo apt-get upgrade -y

#Apache Maven requires Java to be installed on your server. By default, Java is not available in Ubuntu's repository. Add the Oracle Java PPA to Apt with the following command:
sudo add-apt-repository ppa:webupd8team/java

#Next, update your Apt package database with the following command:
sudo apt-get update -y

#Install the latest stable version of Oracle Java 8.
sudo apt-get install oracle-java8-installer

#Verify the Java version by running the following command:
java -version

#Output:
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

Maven

Download and install Apache Maven.

#You can download the latest stable version of Apache Maven from its official website, otherwise you can download it directly with the following command:
cd /opt/
wget http://www-eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

#Once the download has completed, extract the downloaded archive.
sudo tar -xvzf apache-maven-3.3.9-bin.tar.gz

#Next, rename the extracted directory.
sudo mv apache-maven-3.3.9 maven 

#Next, you will need to setup the environment variables such as M2_HOME, M2, MAVEN_OPTS, and PATH. You can do this by creating a mavenenv.sh file inside of the /etc/profile.d/ directory.
sudo nano /etc/profile.d/mavenenv.sh

#Add the following lines:
export M2_HOME=/opt/maven
export PATH=${M2_HOME}/bin:${PATH}

#Save and close the file, update its permissions, then load the environment variables with the following command:
sudo chmod +x /etc/profile.d/mavenenv.sh
sudo source /etc/profile.d/mavenenv.sh

#Once everything has been successfully configured, check the version of the Apache Maven.
mvn --version

#You should see the following output:
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T22:11:47+05:30)
Maven home: /opt/maven
Java version: 1.8.0_101, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.13.0-32-generic", arch: "amd64", family: "unix"

Git Client

If you don’t have git client installed on your host, you can download one from Git website

Go

Install go by following the directions at Getting Started – The Go Programming Language.

Node JS

Install node by following the directions at Node.js JavaScript Runtime

Verify that you have the required minimum version of node and nodemon binaries installed on your system and are included in your runtime path:

$ node --version
v6.9.4
$ npm install -g nodemon
$ nodemon --version
1.11.0

Build Steps

To build Athenz components, change to the top level directory where Athenz code has been checked out and execute:

$ git clone https://github.com/yahoo/athenz.git
$ cd athenz
$ mvn clean install

The release packages will be created automatically in the assembly subdirectory.

Exit mobile version