maven-druid-build-optimization
How to build Apache Druid efficiently with Maven while skipping unnecessary checks and OOM-prone modules. Use this skill when building patched Druid versions, when rebuilding after security fixes, or when the web-console module causes out-of-memory errors.
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 93
- Forks
- 8
01 前言 Front Matter
- name
- maven-druid-build-optimization
- description
- How to build Apache Druid efficiently with Maven while skipping unnecessary checks and OOM-prone modules. Use this skill when building patched Druid versions, when rebuilding after security fixes, or when the web-console module causes out-of-memory errors.
03 SKILL.md 正文
Maven Druid Build Optimization
Overview
Apache Druid is a large project with extensive code quality checks and a heavy web-console module. When building a patched version or in memory-constrained environments, selective skipping of modules and checks optimizes build time and resource usage.
Build Command Structure
The standard optimized build for patched Druid skips:
- Web-console module (
-pl '!web-console') - Frontend build with Node.js dependencies, causes OOM - Unit tests (
-DskipTests) - Can be skipped when applying security patches - Code quality checks - Multiple style, security, and analysis tools
Full Build Command for Patched Druid
cd /root/druid
mvn clean package \
-DskipTests \
-Dcheckstyle.skip=true \
-Dpmd.skip=true \
-Dforbiddenapis.skip=true \
-Dspotbugs.skip=true \
-Danimal.sniffer.skip=true \
-Denforcer.skip=true \
-Djacoco.skip=true \
-Ddependency-check.skip=true \
-pl '!web-console' \
-pl indexing-service \
-am
Understanding the Flags
Module Selection
-pl '!web-console'- Exclude web-console from build (prevents OOM)-pl indexing-service- Include only indexing-service module-am(--also-make) - Build dependencies of selected modules
Test Skipping
-DskipTests- Skip test compilation and execution
Quality Check Skips
These skip code quality tools that can be safely bypassed for patched code:
-Dcheckstyle.skip=true- Checkstyle code style checks-Dpmd.skip=true- PMD static analysis-Dforbiddenapis.skip=true- Forbidden APIs checks-Dspotbugs.skip=true- SpotBugs security analysis-Danimal.sniffer.skip=true- Animal Sniffer API compatibility-Denforcer.skip=true- Maven Enforcer rules-Djacoco.skip=true- Code coverage-Ddependency-check.skip=true- Dependency vulnerability checking
Build Phases
clean- Remove previous build artifactspackage- Compile and create JAR files
Build Output Location
Built artifacts (JAR files) are located at:
druid-indexing-service/target/druid-indexing-service-<version>-<classifier>.jar
Memory Management
If you still encounter OOM errors:
-
Increase Maven heap:
export MAVEN_OPTS="-Xmx2g" -
Build specific modules sequentially:
mvn clean package -pl 'druid-core' -DskipTests -Dcheckstyle.skip=true ... mvn package -pl 'druid-indexing-service' -am -DskipTests -Dcheckstyle.skip=true ...
Verification After Build
After a successful build, verify the JAR was created:
ls -lh druid-indexing-service/target/*.jar
The verifier will deploy the JAR to /opt/druid/lib/ and restart the Druid service before running tests.
Build Troubleshooting
- Timeout issues: Increase Maven timeout:
mvn -DmultiModuleProjectDirectory=. ... - Out of memory: Use
-Xmx4gor higher in MAVEN_OPTS - Module not found: Verify module names with
mvn -pl help:describe - Dependency issues: Run
mvn dependency:treeto verify dependency resolution
04 同仓库更多 Skills
object_counter
Count occurrences of an object in the image using computer vision algorithm.
travel-planning-workflow
Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.
bundled-dataset-search-tool
invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.
glm-output
Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final /root/metrics.json.
glm-calibration
Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.
glm-basics
A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.