skywalking - idea 编译源码
clone 项目
git clone https://github.com/apache/skywalking.git
cd skywalking/
git checkout 8.9.1
git submodule init
git submodule update
编译
-
Import the project as a maven project
-
Run
./mvnw compile -Dmaven.test.skip=true
to compile project and generate source codes. Because we use gRPC and protobuf. -
Set
Generated Source Codes
folders.
grpc-java
andjava
folders in apm-protocol/apm-network/target/generated-sources/protobufgrpc-java
andjava
folders in oap-server/server-core/target/generated-sources/protobufgrpc-java
andjava
folders in oap-server/server-receiver-plugin/receiver-proto/target/generated-sources/protobufgrpc-java
andjava
folders in oap-server/exporter/target/generated-sources/protobufgrpc-java
andjava
folders in oap-server/server-configuration/grpc-configuration-sync/target/generated-sources/protobufantlr4
folder in oap-server/oal-grammar/target/generated-sources
设置 generated-sources
刚编译的时候, Command 类是找不到的,需要设置 generated-sources,以 apm-network为例:
过程
1.执行 mvn.cmd clean package -Dmaven.test.skip
, 结果失败,执行失败,提示缺少部分类,例如缺少类KeyStringValuePair.java
可能是因为git submodule没有更新到submodule,解决办法是:找到上面提到的项目根目录下的/.gitmodules文件,查看submodule对应的path路径,看是否完整更新下来的源码
modules文件,查看submodule对应的path路径,看是否完整更新下来的源码*