Fix Maven wrapper support for snapshot distributions by gnodet · Pull Request #335 · apache/maven-wrapper (original) (raw)
The Maven wrapper scripts (only-mvnw and only-mvnw.cmd) previously failed when using snapshot distributions because they assumed the directory name inside the ZIP file would match the filename pattern. However, for snapshots:
- Filename: apache-maven-4.1.0-20250710.120440-1-bin.zip
- Directory: apache-maven-4.1.0-SNAPSHOT/
This mismatch caused the script to fail when trying to access the extracted directory.
Changes:
- Modified only-mvnw to dynamically detect the actual extracted directory by looking for the Maven executable instead of assuming the name
- Applied the same fix to only-mvnw.cmd for Windows compatibility
- Added comprehensive tests in SnapshotDistributionTest.java
- Added integration test for snapshot distribution handling
- Updated documentation to mention snapshot support
The fix maintains backward compatibility with regular releases while enabling support for Maven snapshot distributions.
Fixes: apache/maven#10894 (comment)
gnodet deleted the fix-snapshot-distribution-support branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})