AGENT SKILL

SkyWalking 编译构建与校验

compile

构建 SkyWalking OAP 服务器,运行 javadoc 检查,并验证 checkstyle。用于在提交 PR 前验证变更。

License 许可
Apache-2.0
所属仓库
apache/skywalking
最近更新
2026-11-15
Stars
★ 2.5w
Forks
6.6k

01 前言 Front Matter

name
compile
description
Build SkyWalking OAP server, run javadoc checks, and verify checkstyle. Use to validate changes before submitting a PR.
argument-hint
[all|backend|javadoc|checkstyle|module-name]

03 SKILL.md 正文

Compile & Verify

Build the project and run static checks matching CI.

Prerequisites

  • JDK 11, 17, or 21 (LTS versions)
  • Maven 3.6+ (use ./mvnw wrapper)

Maven profiles

  • backend (default): Builds OAP server modules
  • ui (default): Builds web application
  • dist (default): Creates distribution packages
  • all: Builds everything including submodule initialization

Commands by argument

all or no argument — full CI build

./mvnw clean flatten:flatten install javadoc:javadoc -B -q -Pall \
  -Dmaven.test.skip \
  -Dcheckstyle.skip \
  -Dgpg.skip

backend — backend only (faster)

./mvnw clean flatten:flatten package -Pbackend,dist -Dmaven.test.skip

javadoc — javadoc check only

Javadoc requires delombok output, so install must run first:

./mvnw clean flatten:flatten install javadoc:javadoc -B -q -Pall \
  -Dmaven.test.skip \
  -Dcheckstyle.skip \
  -Dgpg.skip

Running javadoc:javadoc alone without install will miss errors because ${delombok.output.dir} won't be populated.

checkstyle — checkstyle only

./mvnw -B -q clean flatten:flatten checkstyle:check

Module name — single module build

./mvnw clean flatten:flatten package -pl oap-server/analyzer/<module-name> -Dmaven.test.skip

Reading javadoc output

Maven prefixes all javadoc output with [ERROR], but the actual severity is in the message after the line number. Only lines containing error: fail the build; lines with warning: do not.

[ERROR] Foo.java:42: error: bad use of '>'        ← ACTUAL ERROR (must fix)
[ERROR] Foo.java:50: warning: no @param for <T>   ← WARNING (does not fail build)

Common javadoc errors

Error Cause Fix
bad use of '>' Bare > in javadoc HTML (e.g., -> in <pre> blocks) Use {@code ->} or -&gt;
heading out of sequence Heading level skips the expected hierarchy See heading rules below
reference not found {@link Foo#bar()} with wrong signature Match exact parameter types: {@link Foo#bar(ArgType)}

Javadoc heading rules (JDK 13+)

Strict heading validation was introduced in JDK 13. JDK 11 does not enforce it, but JDK 17/21/25 do. Write headings correctly for forward compatibility:

Javadoc location Start heading at
Class, interface, enum, package, module <h2>
Constructor, method, field <h4>
Standalone HTML files (doc-files/) <h1>

The generated javadoc page uses <h1> for the class name and <h3> for member sections (Methods, Fields, etc.), so class-level subsections must use <h2> and method-level subsections must use <h4> to maintain proper nesting.

CI reference

CI uses JDK 11 on Linux. The dist-tar job runs:

./mvnw clean flatten:flatten install javadoc:javadoc -B -q -Pall \
  -Dmaven.test.skip \
  -Dcheckstyle.skip \
  -Dgpg.skip

The code-style job runs:

./mvnw -B -q clean flatten:flatten checkstyle:check

04 同仓库更多 Skills

apache
apache/skywalking

tal

Write, compile, inspect and verify Trace Analysis Language (TAL) rules for the OTLP and SkyWalking native (sw-native) inputs — rule files, the compiler and runtime map, dumping and decompiling the generated classes, the v1-v2 checker, the branch gate and the benchmark. Use when changing TAL rules, the TAL grammar/compiler, or the native trace analysis.

★ 2.5w
apache
apache/skywalking

单元与集成测试运行

test

运行单元测试、集成测试或与 CI 一致的慢速集成测试。用于在提交 PR 前验证变更。

测试工程师测试与质量保障
★ 2.5w
apache
apache/skywalking

SkyWalking E2E 测试运行

run-e2e

在本地运行 SkyWalking E2E 测试。

测试工程师测试与质量保障
★ 2.5w
apache
apache/skywalking

SkyWalking 发行版与镜像重建

package

在源码变更后重新构建 SkyWalking 发行版和 OAP Docker 镜像。在运行 e2e 测试前使用,以确保镜像反映你的代码改动,避免“镜像看似已更新但运行时仍是旧 jar”的陷阱。

软件开发工程师开发环境与工具链管理
★ 2.5w
apache
apache/skywalking

SkyWalking 监控功能扩展开发

new-monitoring-feature

为 SkyWalking OAP 添加新的监控目标 / 层级。引导你了解 OAL / MAL / LAL / TAL / SpanListener 扩展点、UI 模板与子模块的接入点、必须同步变更的文档集合,以及不属于任何单一技能的跨领域陷阱。

软件开发工程师运维监控与告警
★ 2.5w
apache
apache/skywalking

Apache 许可证头与依赖合规检查

license

使用 skywalking-eyes 检查并修复 Apache 2.0 许可证头及依赖许可证。在提交 PR 前使用。

软件开发工程师开发环境与工具链管理
★ 2.5w