Skip to content

Fix handling of Java versions like 21.0.10.0.1#967

Open
parttimenerd wants to merge 1 commit intoapache:masterfrom
parttimenerd:parttimenerd_java_version_fix
Open

Fix handling of Java versions like 21.0.10.0.1#967
parttimenerd wants to merge 1 commit intoapache:masterfrom
parttimenerd:parttimenerd_java_version_fix

Conversation

@parttimenerd
Copy link
Copy Markdown

The pull request allows the Java version requirement to be satisfied even when the normalized Java version differs, as long as the exact version strings are equal between the expected and the actual versions.

This allows the common CI pattern

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.6.2</version>
        <executions>
          <execution>
            <id>enforce-java</id>
            <phase>validate</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>${java.version}</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

To succeed even when the Java version normalization can't handle the specific version format. This is rather hard to test, but all existing test cases succeed, and the diff is minimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant