Skip to content

bump maven wrapper to 3.3.4#2689

Merged
robfrank merged 1 commit intomainfrom
chore/bump-maven-wrapper
Oct 21, 2025
Merged

bump maven wrapper to 3.3.4#2689
robfrank merged 1 commit intomainfrom
chore/bump-maven-wrapper

Conversation

@robfrank
Copy link
Collaborator

This pull request updates the Maven Wrapper scripts to improve compatibility, robustness, and correctness, especially around extracting and locating the Maven distribution directory. It also updates the wrapper version and makes several improvements to the shell and batch scripts for both Unix and Windows environments.

Maven Wrapper version and script updates:

  • Updated the Maven Wrapper version from 3.3.2 to 3.3.4 in .mvn/wrapper/maven-wrapper.properties, mvnw, and mvnw.cmd. [1] [2] [3]

Robustness and correctness improvements in locating Maven distribution:

  • Enhanced both mvnw (shell) and mvnw.cmd (batch/PowerShell) scripts to correctly identify and move the extracted Maven distribution directory, even when the extracted directory name does not match the archive filename (e.g., for snapshot builds). This includes searching for the directory containing the Maven executable if the expected directory is not found. [1] [2]

Script and environment handling improvements:

  • Improved path and script name handling in mvnw by introducing scriptDir and scriptName variables, and updated references to the properties file accordingly.
  • Fixed the command invocation in mvnw.cmd to properly quote the command for Windows compatibility.
  • Improved handling of the Maven home directory in mvnw.cmd, including support for symbolic links and ensuring the .m2 directory exists. Also switched the hash algorithm for Maven home naming from MD5 to SHA256 for improved security.

Checksum validation fix:

  • Fixed the sha256sum invocation in mvnw to use -c -, ensuring correct validation of the downloaded distribution archive.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @robfrank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on upgrading the Maven Wrapper to version 3.3.4 and significantly enhancing its reliability and compatibility across different operating systems. The changes address issues with correctly identifying Maven distribution directories, particularly for non-standard archive names, and improve script robustness for both Unix and Windows environments. Additionally, it includes security improvements by updating the hashing algorithm used for Maven home directories and fixes a checksum validation issue.

Highlights

  • Maven Wrapper Version Bump: The Maven Wrapper has been updated from version 3.3.2 to 3.3.4 across the .mvn/wrapper/maven-wrapper.properties, mvnw, and mvnw.cmd files.
  • Improved Distribution Location: Enhanced logic in both mvnw (Unix) and mvnw.cmd (Windows) scripts to correctly identify and move the extracted Maven distribution directory, even when the extracted directory name does not perfectly match the archive filename, which is common for snapshot builds.
  • Script Robustness and Compatibility: The mvnw script now uses scriptDir and scriptName variables for more robust path handling. The mvnw.cmd script includes fixes for command invocation quoting for Windows compatibility and improved handling of the Maven home directory, including support for symbolic links and ensuring the .m2 directory exists.
  • Enhanced Security: The mvnw.cmd script has switched the hash algorithm used for Maven home naming from MD5 to SHA256, improving security.
  • Checksum Validation Fix: The sha256sum invocation in the mvnw script has been corrected to use -c - for proper validation of downloaded distribution archives.
  • License Header Removal: The extensive Apache license header has been removed from the .mvn/wrapper/maven-wrapper.properties file.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@robfrank robfrank merged commit 48510ca into main Oct 21, 2025
9 of 10 checks passed
@robfrank robfrank deleted the chore/bump-maven-wrapper branch October 21, 2025 18:19
@robfrank robfrank added this to the 25.10.1 milestone Oct 21, 2025
@mergify
Copy link
Contributor

mergify bot commented Oct 21, 2025

🧪 CI Insights

Here's what we observed from your CI run for dbbcec7.

🟢 All jobs passed!

But CI Insights is watching 👀

@robfrank robfrank added enhancement New feature or request java labels Oct 21, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Maven Wrapper to version 3.3.4, enhancing its robustness and correctness in locating the Maven distribution, especially for snapshot builds. It also includes improvements to script and environment handling, as well as a fix for checksum validation. The changes span across .mvn/wrapper/maven-wrapper.properties, mvnw, and mvnw.cmd files, addressing compatibility and security concerns.

Comment on lines +76 to +77
$MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')"
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The logic for determining $MVNW_REPO_PATTERN seems inverted. If $USE_MVND is false, it should use /org/apache/maven/, and if it's true, it should use /maven/mvnd/. The current logic assigns the patterns in the opposite way, which could lead to incorrect repository URLs being constructed.

$MVNW_REPO_PATTERN = if ($USE_MVND -eq $true) { "/maven/mvnd/" } else { "/org/apache/maven/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')"

Comment on lines +270 to +282
if [ -z "$actualDistributionDir" ]; then
# enable globbing to iterate over items
set +f
for dir in "$TMP_DOWNLOAD_DIR"/*; do
if [ -d "$dir" ]; then
if [ -f "$dir/bin/$MVN_CMD" ]; then
actualDistributionDir="$(basename "$dir")"
break
fi
fi
done
set -f
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The logic to find the actual distribution directory relies on enabling globbing (set +f) and then disabling it (set -f). While functional, this can be simplified by using find command which is more robust and avoids potential issues with filenames containing spaces or special characters. This is especially important in environments where filenames might not be strictly controlled.

Suggested change
if [ -z "$actualDistributionDir" ]; then
# enable globbing to iterate over items
set +f
for dir in "$TMP_DOWNLOAD_DIR"/*; do
if [ -d "$dir" ]; then
if [ -f "$dir/bin/$MVN_CMD" ]; then
actualDistributionDir="$(basename "$dir")"
break
fi
fi
done
set -f
fi
# If not found, search for any directory with the Maven executable (for snapshots)
if [ -z "$actualDistributionDir" ]; then
actualDistributionDir=$(find "$TMP_DOWNLOAD_DIR" -maxdepth 1 -type d -name '*' -exec sh -c 'if [ -f "{}/bin/$MVN_CMD" ]; then echo $(basename "{}"); exit 0; fi' \;)
fi

@codacy-production
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-1.09%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6b35a83) 73090 46386 63.46%
Head commit (dbbcec7) 73090 (+0) 45588 (-798) 62.37% (-1.09%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#2689) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

tae898 pushed a commit to humemai/arcadedb-embedded-python that referenced this pull request Oct 23, 2025
robfrank added a commit that referenced this pull request Nov 10, 2025
(cherry picked from commit 48510ca)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant