bmhm edited a comment on issue #58: [MENFORCER-288] Support new Java versioning schema for older versions. URL: https://github.com/apache/maven-enforcer/pull/58#issuecomment-565736113 Actually, `enforceVersion` compares the systemProperty against a **_version range_**. The version range must be normalized or each put through JavaVersion.parse(). But this will not help, because if the range says (6 through 8), JavaVersion.compare will not accept with a VersionRange argument. Example: I use ```xml <requireJavaVersion> <version>(,7),(7,)</version> <!-- not java 7 --> </requireJavaVersion> ``` Then I get `JavaVersion("1.7")` from the system property. The `compareTo` method is useless, and the version range cannot be normalized. I do not thing `getVersion` should be parsed before handling over to the `enforceVersion` method. Should it? Also, I cannot use `.asMajor()` on the java version system property which drops the 1.x part, because a user could have specified `(,1.7),(1.7,)` in above example. I do not see how this would work, unless we tried to normalize the result from `getVersion` first, which cannot be done by `JavaVersion` either. That said, my commit does only harm as well. It only normalizes the system property, which will never be just "6" or "8". The only thing which COULD be done is to check if `getVersion()` returns a single digit and normalize that.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services