| name | maven-build |
| description | Maven build automation for Spring Boot projects. Handles compilation, packaging, dependency management, and build troubleshooting. USE FOR: build errors, dependency issues, Maven wrapper, packaging, compilation failures, dependency tree analysis.
|
Maven Build Skill
Procedure
Build Commands (always use Maven Wrapper)
./mvnw clean compile
./mvnw clean package -DskipTests
./mvnw clean package
./mvnw clean install
./mvnw dependency:tree
./mvnw dependency:tree -Dincludes=groupId
./mvnw versions:display-dependency-updates
./mvnw help:effective-pom
Troubleshooting Build Failures
- Compilation Error: Read the error, find the file and line, fix the Java code
- Dependency Conflict: Run
./mvnw dependency:tree to find conflicts, use <exclusions> in pom.xml
- Maven Wrapper Missing: Run
mvn wrapper:wrapper to regenerate
- Out of Memory: Set
MAVEN_OPTS="-Xmx1024m" before running
Adding Dependencies
When adding a dependency to pom.xml:
- Add the
<dependency> block in the appropriate section
- Run
./mvnw compile to verify resolution
- Run
./mvnw test to verify compatibility
- Run
./mvnw dependency:tree to check for conflicts
Profile Management
./mvnw clean package -P production
./mvnw spring-boot:run -Dspring-boot.run.profiles=dev