# Invalid version format: '1.0.0-SNAPSHOT ' (trailing whitespace) in dependency com.example:lib:1.0.0-SNAPSHOT 

- **ID:** `java/maven-invalid-version-format`
- **Domain:** java
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The version string contains leading or trailing whitespace, which is not allowed by Maven's version parser.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 8+ | active | — | — |

## Workarounds

1. **Trim whitespace from the version string in pom.xml** (100% success)
   ```
   <version>1.0.0-SNAPSHOT</version> (no trailing spaces)
   ```
2. **Use a properties file to define the version without whitespace** (95% success)
   ```
   <properties><lib.version>1.0.0-SNAPSHOT</lib.version></properties> and reference ${lib.version}
   ```

## Dead Ends

- **Using a different version without whitespace but not the intended one** — The dependency may not exist at that version, causing a resolution error. (80% fail)
- **Ignoring the error and hoping it works** — Maven will fail to parse the version and abort the build. (99% fail)
