Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump new maven version 3.9.4 #2178

Merged
merged 1 commit into from Sep 21, 2023
Merged

Bump new maven version 3.9.4 #2178

merged 1 commit into from Sep 21, 2023

Conversation

velo
Copy link
Member

@velo velo commented Sep 21, 2023

Summary by CodeRabbit

  • Chore: Upgraded Apache Maven to version 3.9.4 and Maven Wrapper to version 3.2.0 for improved build performance and stability.
  • Refactor: Enhanced the Maven Wrapper startup scripts (mvnw and mvnw.cmd) for better compatibility across different operating systems, more reliable JAR file downloading from Maven Central, and added SHA-256 checksum validation for increased security.
  • Chore: Updated the location of mavenrc_pre.bat and mavenrc_pre.cmd files to %USERPROFILE% for easier access and management.

@coderabbitai
Copy link

coderabbitai bot commented Sep 21, 2023

Walkthrough

This pull request primarily focuses on upgrading the Apache Maven and Maven Wrapper versions, enhancing the startup scripts' reliability and flexibility, and improving compatibility across different operating systems. It also introduces checksum validation for the Maven Wrapper JAR file to ensure its integrity.

Changes

File Summary
.mvn/wrapper/maven-wrapper.properties Upgraded Apache Maven from 3.8.7 to 3.9.4 and Maven Wrapper from 3.1.1 to 3.2.0.
mvnw, mvnw.cmd Updated startup scripts with enhanced handling of JAVA_HOME, project base directory discovery, and Maven Wrapper JAR file download. Added SHA-256 checksum validation and improved OS compatibility and logging functionality.

🐇💻

In the land of code where the shadows lie,

An upgrade was made, under the cloudless sky.

Maven and Wrapper, both renewed,

With scripts that are now finely tuned.

Checksums checked, paths well-trodden,

In the realm of bits, nothing is forgotten.

So here's to changes, big and small,

May our code stand tall, through it all! 🎉🥕


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • Mention @coderabbitai in any review comment for bot assistance.
  • Note: Review comments are made on code diffs or files, not on the PR overview.

Pause Incremental Reviews

  • Insert @coderabbitai: ignore in the PR description to halt the bot's ongoing reviews. Remove the line to resume.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Commits Files that changed from the base of the PR and between e36c366 and c00d18b.
Files selected for processing (3)
  • .mvn/wrapper/maven-wrapper.properties (1 hunks)
  • mvnw (5 hunks)
  • mvnw.cmd (6 hunks)
Files skipped from review due to trivial changes (1)
  • .mvn/wrapper/maven-wrapper.properties
Additional comments (Suppressed): 11
mvnw.cmd (6)
  • 21-31: The version of the Apache Maven Wrapper startup batch script has been updated from 2 to 3.2.0. Ensure that this change is compatible with the rest of your project.

  • 196-197: The location of mavenrc_pre.bat, mavenrc_pre.cmd, mavenrc_post.bat, and mavenrc_post.cmd files has been changed from %HOME% to %USERPROFILE%. Verify that these scripts are present in the new location and that they are correctly referenced throughout the codebase.

  • 38-40: A new line has been added to set the title of the command window to the name of the batch file (%0). This doesn't affect the functionality of the script but could improve user experience by making it easier to identify the command window when multiple windows are open.

  • 122-153: New functionality has been added to automatically download the maven-wrapper.jar file from Maven Central if it doesn't exist locally. This is a useful feature for projects that prohibit checking in binary data. However, ensure that the specified URL is correct and accessible, and that the downloaded file is placed in the correct directory.

  • 156-172: Another new feature validates the SHA-256 checksum of the downloaded maven-wrapper.jar file. This is a good security practice as it ensures the integrity of the downloaded file. However, make sure that the specified checksum in maven-wrapper.properties matches the actual checksum of the maven-wrapper.jar file.

  • 174-185: The way CLI arguments are retrieved has been standardized across all platforms. This should improve the portability of the script. However, verify that this change doesn't break any existing functionality or cause issues on specific platforms.

mvnw (5)
  • 22-32: The version of the Apache Maven Wrapper startup batch script has been updated from 2 to 3.2.0. Ensure that this change is compatible with the rest of your project and that all dependencies are still met.

  • 53-108: The logic for determining the operating system and setting the JAVA_HOME environment variable has been significantly changed. The new hunk simplifies the process of finding the Java home directory on Darwin (macOS) systems and adds additional checks for the JAVA_HOME environment variable on other systems. It also includes a workaround for a specific issue on Solaris 10/Sparc systems. Make sure these changes are compatible with your project's requirements and the environments it will be run in.

  • 118-124: The method for determining the JAVACMD variable has been slightly altered. Instead of using which java, the new hunk uses command -v java. This should have the same effect, but verify that this change does not cause any issues in your project.

  • 132-300: This new hunk introduces several new functions and features. The find_maven_basedir function traverses the directory structure from the process work directory to the filesystem root to find the project base directory. The concat_lines function concatenates all lines of a file. A logging function log is introduced which only logs messages if MVNW_VERBOSE is set to true.

A significant addition is the mechanism for automatically downloading the maven-wrapper.jar from Maven Central if it doesn't exist locally, and validating its SHA-256 checksum. This is a useful feature for projects that prohibit checking in binary data, but make sure to verify the download URL and checksum for security reasons.

The new hunk also changes how CLI arguments are retrieved to be more standardized across all platforms.

These changes improve the script's functionality and compatibility, but they should be thoroughly tested to ensure they work as expected in your project.

  • 302-308: The command used to execute the Maven Wrapper has been slightly altered. The -Dmaven.home=${M2_HOME} argument has been removed, and the MAVEN_OPTS and MAVEN_DEBUG_OPTS variables have been added. Make sure these changes do not affect the execution of the Maven Wrapper in your project.

Comment on lines 35 to 44

if [ -z "$MAVEN_SKIP_RC" ] ; then

if [ -f /usr/local/etc/mavenrc ] ; then
. /usr/local/etc/mavenrc
fi

if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
Copy link

Choose a reason for hiding this comment

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

The new hunk adds an additional check for a mavenrc file in /usr/local/etc/mavenrc. This allows for more flexibility in where the mavenrc file can be located, but make sure that this location is appropriate for your project's setup.

@velo velo merged commit 0dfcd18 into master Sep 21, 2023
3 checks passed
@velo velo deleted the mvn-3.9.4 branch September 21, 2023 09:27
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.

None yet

1 participant