build
Build the Java project — detects Maven or Gradle and runs a clean build with test execution
/java-core:build
Build the Java project and report the result.
Instructions
-
Detect the build tool:
- If
pom.xmlexists → Maven - If
build.gradleorbuild.gradle.ktsexists → Gradle - If neither found → tell the user and stop
- If
-
Run the build:
- Maven:
mvn clean package - Gradle:
./gradlew clean build
- Maven:
-
Parse the output:
- On success: report
BUILD SUCCESS, total time, and test results summary (tests run, failures, errors, skipped) - On failure: show the first failing error with file:line, describe the root cause in plain English, and suggest a fix
- On success: report
-
If tests fail specifically (build compiled but tests red):
- List each failing test with method name and failure message
- Suggest running
/java-quality:testfor targeted test generation