← 返回
未分类 中文

Maven Pom Validator

Validate and lint Maven pom.xml files for structure, dependencies, plugins, and best practices. Use when asked to lint, validate, check, or audit pom.xml fil...
校验并检查Maven pom.xml文件的结构、依赖、插件及最佳实践。在需要审查、校验、检查或审计pom.xml时使用。
charlie-morrison charlie-morrison 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 391
下载
💾 1
安装
1
版本
#latest

概述

Maven POM Validator

Validate and lint Maven pom.xml files for structural correctness, dependency hygiene, plugin configuration, and best practices.

Commands

lint — Full lint pass (all 20+ rules)

python3 scripts/maven_pom_validator.py lint pom.xml
python3 scripts/maven_pom_validator.py lint pom.xml --strict
python3 scripts/maven_pom_validator.py lint pom.xml --format json
python3 scripts/maven_pom_validator.py lint pom.xml --format markdown

dependencies — Audit dependency declarations

python3 scripts/maven_pom_validator.py dependencies pom.xml
python3 scripts/maven_pom_validator.py dependencies pom.xml --format json

plugins — Audit plugin declarations

python3 scripts/maven_pom_validator.py plugins pom.xml
python3 scripts/maven_pom_validator.py plugins pom.xml --format markdown

validate — Quick structural validation only

python3 scripts/maven_pom_validator.py validate pom.xml
python3 scripts/maven_pom_validator.py validate pom.xml --strict

Flags

FlagDescription
-------------------
--strictExit code 1 on warnings (CI mode)
--format textHuman-readable output (default)
--format jsonMachine-readable JSON
--format markdownMarkdown report

Lint Rules

Structure (5 rules)

  1. Valid XML — file must be well-formed XML
  2. Required elements — groupId, artifactId, version, modelVersion must be present
  3. modelVersion must be "4.0.0"
  4. groupId format — must follow reverse-domain convention (e.g. com.example)
  5. packaging value must be valid (jar, war, pom, ear, rar, maven-plugin)

Dependencies (6 rules)

  1. No duplicate dependencies (same groupId:artifactId)
  2. No SNAPSHOT versions in release POMs
  3. Version must be defined (not missing)
  4. No wildcard/range versions (LATEST, RELEASE, [1.0,))
  5. Scope must be valid (compile, test, provided, runtime, system, import)
  6. system-scoped deps must have

Plugins (5 rules)

  1. Plugin versions must be pinned
  2. No duplicate plugins (same groupId:artifactId)
  3. Plugin groupId should be specified
  4. Known deprecated plugins flagged
  5. Configuration elements checked for common issues

Best Practices (6 rules)

  1. Properties used for version management (DRY check)
  2. dependencyManagement used in parent POMs
  3. UTF-8 encoding specified (project.build.sourceEncoding)
  4. Java source/target version set (maven.compiler.source/target or release)
  5. No hardcoded absolute paths in configuration
  6. SCM section present

Exit Codes

CodeMeaning
---------------
0No errors (warnings OK unless --strict)
1Errors found (or warnings with --strict)
2Script usage error

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-07 06:06 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

Vulnerability Prioritizer

charlie-morrison
在CVSS评分之外,利用EPSS、CISA KEV、资产关键性、可达性分析以及利用成熟度进行漏洞优先级排序
★ 1 📥 506
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 72 📥 181,992
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 195 📥 67,717