Build and Installation
There are two ways to use the DID Java SDK. One is to use the package manager of Gradle or Maven to download the binary package compiled and published by the developer directly from the package repository - the other is to download the source code to build it. The package manager is recommended for ordinary developers.
For advanced developers (or DID SDK contributors), building from the source code is an effective choice and solution.

Pre-built Package

Maven

1
<dependency>
2
<groupId>org.elastos.did</groupId>
3
<artifactId>didsdk</artifactId>
4
<version>2.1.3</version>
5
</dependency>
Copied!

Gradle

1
dependencies {
2
implementation 'org.elastos.did:didsdk:2.1.3'
3
}
Copied!

Build from source

Before you start, you need to install the Java 8 compatible development environment and Git.
Download the code:
1
git clone https://github.com/elastos/Elastos.DID.Java.SDK.git
2
cd Elastos.DID.Java.SDK
Copied!
Build at the command line:
1
./gradlew build
Copied!
With this command, you can complete the compilation and testing of the code, as well as the packaging of the jar package.
Because the DID Java SDK contains numerous test cases, the process of running test cases may take a long time. If you want to skip this part, you can use the following command to build it:
1
./gradlew build -x test
Copied!