AgentSkillsCN

maven

Maven 依赖版本检查与安全漏洞扫描。适用于检查 Maven 工件版本、查找更新、使用 Trivy 扫描 CVE,以及分析 POM 文件时使用。

SKILL.md
--- frontmatter
name: maven
description: Maven dependency version checking and security vulnerability scanning. Use for checking Maven artifact versions, finding updates, scanning for CVEs with Trivy, and analyzing POM files.
allowed-tools:
  - Bash
  - Read
  - Grep
  - Glob

Maven Skill

IMPORTANT: Intent Detection

Parse user input to determine intent:

User InputIntentAction
help, how to use, usage, formatHelpRespond with usage info below
check <dependency> or version checkCheck VersionRun check.py check
batch or multiple dependenciesBatch CheckRun check.py batch
list or available versionsList VersionsRun check.py list
scan or security/vulnerabilitiesSecurity ScanRun scan.py scan
analyze or POM analysisAnalyze POMRun scan.py analyze

Version Checking (/maven check)

Check Maven artifact versions and find available updates.

Usage

code
/maven check spring-core 5.3.0
/maven check org.springframework:spring-core 5.3.10
/maven batch '[ {"dependency": "spring-core", "version": "5.3.0"} ]'
/maven list spring-core

Examples

CommandWhat It Does
/maven check spring-core 5.3.0Check if version exists and find updates
/maven check org.springframework:spring-core 5.3.10 --jsonJSON output for parsing
/maven batch --file deps.jsonCheck multiple dependencies from file
/maven list org.apache.commons:commons-lang3List all available versions

Options

OptionDescription
--dependencyMaven coordinate (groupId:artifactId)
--versionVersion to check
--packagingPackage type (jar, pom, war). Default: jar
--jsonOutput as JSON

Security Scanning (/maven scan)

Scan Maven projects for security vulnerabilities using Trivy.

Usage

code
/maven scan /path/to/project
/maven scan /path/to/pom.xml --severity high,critical
/maven analyze /path/to/pom.xml

Examples

CommandWhat It Does
/maven scan .Scan current directory for vulnerabilities
/maven scan --path /project --severity criticalOnly show critical vulnerabilities
/maven analyze pom.xmlParse POM and show dependencies
/maven analyze pom.xml --check-versionsShow dependencies with update info

Options

OptionDescription
--pathPath to project directory or pom.xml
--severityFilter by severity: critical, high, medium, low
--jsonOutput as JSON
--check-versionsAlso check for version updates (analyze only)

Prerequisites

Security scanning requires Trivy to be installed:

bash
# macOS
brew install trivy

# Linux
sudo apt-get install trivy

AI Execution (Internal)

Version Check

bash
uv run .claude/skills/maven/scripts/check.py check \
  --dependency "org.springframework:spring-core" \
  --version "5.3.0" \
  [--packaging jar] \
  [--json]

Batch Check

bash
uv run .claude/skills/maven/scripts/check.py batch \
  --dependencies '[{"dependency": "org.springframework:spring-core", "version": "5.3.0"}]' \
  [--json]

List Versions

bash
uv run .claude/skills/maven/scripts/check.py list \
  --dependency "org.springframework:spring-core" \
  [--json]

Security Scan

bash
uv run .claude/skills/maven/scripts/scan.py scan \
  --path "/path/to/project" \
  [--severity "critical,high"] \
  [--json]

POM Analysis

bash
uv run .claude/skills/maven/scripts/scan.py analyze \
  --path "/path/to/pom.xml" \
  [--check-versions] \
  [--json]

Output Presentation

Present the script output directly to the user. Do NOT summarize unless requested.


Command Quick Reference

CommandDescription
checkCheck single dependency version and updates
batchCheck multiple dependencies at once
listList all available versions for a dependency
scanScan project for security vulnerabilities
analyzeParse and analyze POM file structure

Reference Files