Skip to content

Conversation

@jdaugherty
Copy link
Contributor

@matrei had a ClassNotFoundException thrown when testing the 7.0.0-RC2 wrapper locally. Upon researching the problem, the cause was he had an old snapshot version under the directory we download grails releases to. The reason this was a problem is we were returning snapshot builds as eligible & the wrapper assumes snapshots are more up to date than a release.

This line is the problem:

return new LinkedHashSet<>(List.of(GrailsReleaseType.values()));

That code should only return release types later than the version of the packaged wrapper:

  return new LinkedHashSet<>(myVersion.releaseType.upTo());

I wanted to add test coverage to the wrapper though, so I've refactored the helper methods for preferred version & allowed types to make this easier to test. The test "allowed release types - no preferred version - non-development for non-release" makes sure this issue doesn't happen in the future.

With the refactoring, the jar size is 30KB, which is still smaller than the gradle wrapper size (44KB) so I'm considering the extra classes as an acceptable.

Copy link
Contributor

@matrei matrei left a comment

Choose a reason for hiding this comment

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

Thank you!

@jdaugherty jdaugherty merged commit 5bf8241 into apache:7.0.x Sep 5, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants