AgentSkillsCN

build-validation

适用于Java Maven项目的构建与验证工作流。可在提交代码前使用,或在排查构建错误时使用。

SKILL.md
--- frontmatter
name: build-validation
description: Build and validation workflow for Java Maven projects. Use before committing code or when troubleshooting build errors.

Build Validation Workflow

Complete Validation Sequence

bash
# 1. Verify environment
java -version    # Must be 21+
mvn -version     # Must be 3.8+

# 2. Clean build
mvn clean compile   # Must succeed with zero errors

# 3. Run tests
mvn test            # All tests must pass

# 4. Package
mvn package         # JAR created in target/

# 5. Generate test data (if DataGenerator exists)
java -cp target/classes com.ibm.pl1ref.util.DataGenerator
# Verify: data/CUSTFILE.txt and data/TRANFILE.txt exist, all records 80 bytes

# 6. Run application
java -cp target/psam-translation-0.1.0.jar com.ibm.pl1ref.Main
# Verify: output/REPORT.txt created with expected content

Troubleshooting

ProblemSolution
package does not existCheck pom.xml dependencies, run mvn clean compile
Could not find main classCheck manifest Main-Class, verify class exists
illegal start of expressionMissing } — count braces
Data files not foundCheck working directory is project root

Pre-Commit Checklist

  • mvn clean compile — zero errors
  • mvn package — JAR created
  • Data files generated (if applicable)
  • Application runs without exceptions
  • Output files contain expected content