For a Maven project, add the following to your pom.xml
file:
<dependency>
<groupId>io.mosn.layotto</groupId>
<artifactId>runtime-sdk-parent</artifactId>
<version>1.0.0</version>
</dependency>
Clone this repository including the submodules:
git clone https://github.com/mosn/layotto.git
Build and run Layotto:
# make sure you replace this` ${projectpath}` with your own project path.
cd ${projectpath}/cmd/layotto
go build
./layotto start -c ../../configs/config_redis.json
Then head over to build the java-sdk Maven (Apache Maven version 3.x) project:
# make sure you replace this` ${projectpath}` with your own project path.
cd ${projectpath}/sdk/java-sdk
mvn clean install
Try the following examples to learn more about this SDK:
Compile before submit your pull request:
mvn clean compile
It will format your code automatically.
make proto
The script will download the layotto proto files and compile them automatically.
option
fields in these proto filesMake sure these option
fields have been configurated.
spec/proto/runtime/v1/appcallback.proto :
option java_outer_classname = "AppCallbackProto";
option java_package = "spec.proto.runtime.v1";
spec/proto/runtime/v1/runtime.proto :
option java_outer_classname = "RuntimeProto";
option java_package = "spec.proto.runtime.v1";
JAVA
files# make sure you replace this `${your PROJECT path}` with your own project path.
cd ${your PROJECT path}
mvn compile
Our CI will do it automatically.
If it's a snapshot version, e.g. 1.2.0-SNAPSHOT
, it will be published to the central snapshot
repo;
If it's not a snapshot version, e.g. 1.2.0
, it will be published to the central staging
repo.
Check the Release
pipeline for more details.
Release without staging
pipeline will publish the jars to the central release
repo instead of the staging
repo.