GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix handling of Java versions like 21.0.10.0.1 by parttimenerd · Pull Request #967 · apache/maven-enforcer

Conversation

@parttimenerd

@parttimenerd parttimenerd commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

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.

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@parttimenerd
Add fix for 21.0.10.0.1 issue
5389bf7
@parttimenerd parttimenerd mentioned this pull request Mar 24, 2026
Handling of Java versions like 21.0.10.0.1 fails #966
Closed
cstamas
cstamas approved these changes May 14, 2026
View reviewed changes
slawekjaranowski
slawekjaranowski approved these changes May 14, 2026
View reviewed changes

@slawekjaranowski slawekjaranowski left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, but some of tests for it will be appreciated

We can replace

String javaVersion = SystemUtils.JAVA_VERSION;

by method

getJavaVersion() {
 return SystemUtils.JAVA_VERSION;
}

which can be overridden for test

and can be easy for testing

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cstamas cstamas mentioned this pull request May 14, 2026
Make UTs for #967 #980
Closed
@cstamas
cstamas merged commit fd4b148 into apache:master May 14, 2026
17 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added this to the 3.6.3 milestone May 14, 2026
@github-actions github-actions Bot assigned cstamas May 14, 2026
@cstamas cstamas added the bug Something isn't working label May 14, 2026
@AzazelSensei AzazelSensei mentioned this pull request Aug 27, 2026
Add tests for requireJavaVersion five-part JDK strings #980 #1019
Merged
6 of 7 tasks
@apache apache deleted a comment from github-actions Bot Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cstamas cstamas cstamas approved these changes
@slawekjaranowski slawekjaranowski slawekjaranowski approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@cstamas cstamas

Labels

bug Something isn't working

Projects

None yet

Milestone

3.6.3

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@parttimenerd @cstamas @slawekjaranowski
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.