ccmvn
npx skills add https://github.com/ctalau/ccmvn-skill --skill ccmvn
Agent 安装分布
Skill 文档
Maven Build with ccmvn
The ccmvn tool enables Maven to run in restricted sandbox environments where outbound HTTPS is blocked or DNS resolution is unavailable. It works by creating a local HTTP proxy that Maven uses to access Maven Central.
When to Use This Skill
- Running Maven builds (
clean install,package,test,compile, etc.) - Building Java projects that depend on Maven Central
- Working in sandboxed environments with network restrictions
- Needing to execute Maven with custom parameters and options
Prerequisites
Before using this skill, ensure:
- Maven is installed: The system must have Maven 3.x installed
- Node.js is available: Required for the proxy server (typically pre-installed in Claude Code)
- Proxy configuration (for sandboxed Claude Code): The
HTTPS_PROXYenvironment variable should be set if in a restricted sandbox
Basic Usage
Simple Build
npx ccmvn clean install
Other Common Commands
# Package the project
npx ccmvn package
# Run tests
npx ccmvn test
# Compile only
npx ccmvn compile
# Custom parameters
npx ccmvn clean install -DskipTests
npx ccmvn clean install -X # Debug output
How ccmvn Works
ccmvn creates a three-layer proxy chain:
Maven â Local Proxy â Upstream Sandbox Proxy â Maven Central
(HTTP) (HTTP CONNECT) (HTTP/2 over TLS)
Architecture Layers
-
Maven â Local Proxy (localhost:8080)
- Plain HTTP communication
- Maven configured via
~/.m2/settings.xml - No authentication required locally
-
Local Proxy â Upstream Proxy
- HTTP CONNECT tunneling with JWT authentication
- Upstream proxy performs DNS resolution for sandboxed environments
-
Local Proxy â Maven Central
- HTTP/2 over TLS with ALPN negotiation
- Secure connection to Maven Central repositories
Automatic Configuration
ccmvn automatically:
- Creates
~/.m2/settings.xmlif it doesn’t exist - Configures Maven to use the local proxy as a mirror for Maven Central
- Starts the proxy server before running Maven
- Cleans up the proxy server after Maven completes
Common Maven Commands
| Command | Purpose |
|---|---|
ccmvn clean |
Remove build artifacts |
ccmvn compile |
Compile source code |
ccmvn test |
Run tests |
ccmvn package |
Create JAR/WAR file |
ccmvn install |
Install to local repository |
ccmvn deploy |
Deploy to remote repository |
ccmvn clean install |
Full clean build and install |
Advanced Options
Skip Tests During Build
npx ccmvn clean install -DskipTests
Run with Debug Output
npx ccmvn clean install -X
Specify Specific Goals
npx ccmvn clean compile test-compile
Use Custom Settings File
Maven will automatically use ~/.m2/settings.xml. To verify or modify proxy settings, check this file after running ccmvn.
Troubleshooting
Proxy Connection Issues
If you see proxy-related errors:
- Ensure
HTTPS_PROXYenvironment variable is correctly set (if in a sandboxed environment) - Check that the proxy server can reach Maven Central
- Verify your proxy credentials are correct
Maven Not Found
If Maven is not installed:
# Install Maven (varies by system)
brew install maven # macOS
apt-get install maven # Ubuntu/Debian
Maven Central Timeout
If builds timeout accessing Maven Central:
- Check your network connection
- Try again – temporary network issues can cause timeouts
- Use
-Xflag for debug output to see where it’s hanging
Settings.xml Issues
ccmvn automatically creates ~/.m2/settings.xml if missing. If you have a custom settings file:
- Backup your current
~/.m2/settings.xml - Remove it and let ccmvn create a fresh one
- Or manually add the proxy mirror configuration
Examples
Building a Spring Boot Application
npx ccmvn clean package -DskipTests
Running Unit Tests
npx ccmvn clean test
Full Build with All Checks
npx ccmvn clean install
Building Specific Module (in multi-module project)
npx ccmvn clean install -pl module-name
Environment Variables
HTTPS_PROXY (Sandboxed Environments Only)
Format: http://username:jwt_token@host:port
This is automatically used by ccmvn for sandboxed Claude Code environments. In local development, this is typically not needed.
Security
- Local proxy only: The proxy server is only accessible on localhost
- TLS validation: TLS certificates are validated for Maven Central
- End-to-end encryption: Connection through the proxy chain maintains encryption
- Token protection: JWT tokens are only used for authentication to the upstream proxy
Performance Tips
- First build: Initial builds will download dependencies – this takes longer
- Incremental builds: Subsequent builds with cached dependencies are much faster
- Skip tests if not needed: Use
-DskipTeststo speed up builds during development - Use clean install sparingly: Only use
cleanwhen you have problems or need a fresh build