源碼地址
gitee源碼下載地址:https://gitee.com/OpenSkywalking/sky-walking
子模塊初始化以及源碼拉取
執(zhí)行命令
git submodule init
git submodule update
git submodule update 這步驟很關(guān)鍵靠闭,因?yàn)樵撁顣?huì)獲取skywalking子模塊的源碼供汛,子模塊包括apm-network戈擒、query-graphsql-plugin鹏氧、skywalking-ui单绑、e2e-ttl-es恶守,具體子模塊源碼的路徑可以查看項(xiàng)目根路徑下的.gitmodules文件中
[submodule "apm-protocol/apm-network/src/main/proto"]
path = apm-protocol/apm-network/src/main/proto
url = https://github.com/apache/skywalking-data-collect-protocol.git
[submodule "oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol"]
path = oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol
url = https://github.com/apache/skywalking-query-protocol.git
[submodule "skywalking-ui"]
path = skywalking-ui
url = https://github.com/apache/skywalking-rocketbot-ui.git
[submodule "test/e2e/e2e-protocol/src/main/proto"]
path = test/e2e/e2e-protocol/src/main/proto
url = https://github.com/apache/skywalking-data-collect-protocol.git
構(gòu)建成敗也在于該命令是否能順利進(jìn)行养晋,一般遇到的問題是長(zhǎng)時(shí)間沒有反應(yīng)温兼,獲取拉去子模塊源碼失敗,現(xiàn)象可能就是上述4個(gè)模塊就只有一個(gè)文件夾帖族,其中沒有任何內(nèi)容栈源,導(dǎo)致上述現(xiàn)象的原因一般是因?yàn)樽幽K源碼是需要到github.com取拉去,而很多時(shí)候我們?nèi)ピL問github.com的時(shí)候會(huì)訪問超時(shí)竖般,由于DNS解析耗時(shí)導(dǎo)致的甚垦,從而無法順利拉取
image.png
解決github.com訪問超時(shí)的方案:
進(jìn)入https://www.ipaddress.com/網(wǎng)站,輸入github.com
image.png
查詢github.com在用ip如
image.png
在本機(jī)的host文件中添加github.com的配置
140.82.114.3 github.com
配置后在重新執(zhí)行
git submodule update
順利拉取源碼后
#在skywalking目錄下執(zhí)行命令
mvn clean package -DskipTests
#編譯agent包涣雕,由于第一次已構(gòu)建過源碼了艰亮,所以為了避免再次全部執(zhí)行全部構(gòu)建
mvn package -Pagent,dist -DskipTests
#編譯backend包并且打完整包
mvn package -Pbackend,dist -DskipTests
#編譯UI并且打完整包
mvn package -Pui,dist -DskipTests
打包成功后,會(huì)在dist目錄下生成兩個(gè)包
image.png