Maven
Wrapper Commands
Use Maven Wrapper to ensure consistent Maven versions across your team. No need to install Maven globally — the wrapper downloads the correct version automatically.
20 commands
Pro Tips
Generate wrapper: 'mvn wrapper:wrapper -Dmaven=3.9.6' to pin a specific Maven version for your project.
Use './mvnw' instead of 'mvn' in all project scripts and CI pipelines for consistent versions.
Commit .mvn/wrapper/ to git so all team members and CI use the same Maven version.
Common Mistakes
The wrapper downloads Maven on first run. Ensure CI has network access or pre-cache the distribution.
Make mvnw executable on Unix: 'chmod +x mvnw' — git may not preserve executable permissions.