HADOOP-19790. Updating Minimum Required Maven Version For Hadoop Build#8214
HADOOP-19790. Updating Minimum Required Maven Version For Hadoop Build#8214anujmodi2021 wants to merge 5 commits intoapache:trunkfrom
Conversation
|
Here is a small patch for changing the min required maven version. Also please let me know if any additional testig is needed. |
|
💔 -1 overall
This message was automatically generated. |
|
the current dev container uses 3.9.9, and building docs guides to use maven 3.3+, please search and udpate it everywhere for consistency 3.9.9+ might be good enough if you want to minimize the change (avoid touching Dockerfiles, but only building docs) update: I have wrong memory, it should be 3.9.11 |
BUILDING.txt
Outdated
| $ sudo apt-get -y install maven | ||
|
|
||
| Note: Above command might not the required Maven version i.e.3.9.9 or later. | ||
| In that case, download and install Maven manually from https://maven.apache.org/download.cgi |
There was a problem hiding this comment.
even ubuntu 24.04 apt repo installs old maven 3.8.7, let's just replace it with manual install commands
|
Thanks a lot for your review @pan3793 and pointing out missed spots in the upgrade. |
BUILDING.txt
Outdated
| $ sudo apt-get -y install openjdk-17-jdk | ||
| * Maven | ||
| $ sudo apt-get -y install maven | ||
| Most package managers do not install required version of Maven i.e. 3.9.9 or later. |
There was a problem hiding this comment.
Should we add maven installation commands as well ?
There was a problem hiding this comment.
maybe say "compatible maven version" and then where the version requirement is declared. This is just to remove a place where changes are needed the next time a maven update is mandated
BUILDING.txt
Outdated
| Most package managers do not install required version of Maven i.e. 3.9.9 or later. | ||
| Download and Install Maven manually from https://maven.apache.org/install.html |
There was a problem hiding this comment.
let's replace this with the real commands
| Most package managers do not install required version of Maven i.e. 3.9.9 or later. | |
| Download and Install Maven manually from https://maven.apache.org/install.html | |
| $ curl -L https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.tar.gz > apache-maven-3.9.11-bin.tar.gz | |
| $ tar -zxvf apache-maven-3.9.11-bin.tar.gz -C /opt | |
| $ sudo ln -s /opt/apache-maven-3.9.11/bin/mvn /usr/bin |
Oops, I have the wrong memory, the dev container actually uses Maven 3.9.11, not 3.9.9, sorry for the misleading. Could you update the docs to use 3.9.11?
There was a problem hiding this comment.
No issues, thanks for checking.
I have made the changes
BUILDING.txt
Outdated
| $ sudo nano /etc/profile.d/maven.sh | ||
| $ export M2_HOME=/opt/maven | ||
| $ export MAVEN_HOME=/opt/maven | ||
| $ export PATH=${M2_HOME}/bin:${PATH} | ||
| $ sudo chmod +x /etc/profile.d/maven.sh | ||
| $ source /etc/profile.d/maven.sh |
There was a problem hiding this comment.
below setup is unnecessary if we create a soft link /usr/bin/mvn, please keep things simple
| $ sudo nano /etc/profile.d/maven.sh | |
| $ export M2_HOME=/opt/maven | |
| $ export MAVEN_HOME=/opt/maven | |
| $ export PATH=${M2_HOME}/bin:${PATH} | |
| $ sudo chmod +x /etc/profile.d/maven.sh | |
| $ source /etc/profile.d/maven.sh |
pan3793
left a comment
There was a problem hiding this comment.
LGTM, except for a minor comment
Thanks for your review @pan3793 |
steveloughran
left a comment
There was a problem hiding this comment.
Added a signature verification stage before untarring and linking to the maven binary.
| Most package managers do not install required version of Maven i.e. 3.9.11 or later. | ||
| Following commands download and install Maven manually | ||
| $ curl -L https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.tar.gz > apache-maven-3.9.11-bin.tar.gz | ||
| $ tar -zxvf apache-maven-3.9.11-bin.tar.gz -C /opt |
There was a problem hiding this comment.
add a checksum/signature validation stage if we are putting in code for people to run, or at least recommend it.
curl -L https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.tar.gz.asc > apache-maven-3.9.11-bin.tar.gz.asc
curl -L https://downloads.apache.org/maven/KEYS > KEYS
gpg --import KEYS
gpg --verify apache-maven-3.9.11-bin.tar.gz.ascThere was a problem hiding this comment.
@steveloughran, if you look at the context, no installation does such verification. can we make the guide simple to match the context for now?
later we can consider Maven Wrapper https://maven.apache.org/tools/wrapper/, then ./mvnw would automatically trigger the requested version of Maven downloading, which is a much simpler way. (my previous try was abandoned because I didn't figure out how to let Yetus invoke ./mvnw instead of mvn under $PATH, but it's simple if we keep mvn for Yetus and add a ./mvnw as an alternative for developers)
There was a problem hiding this comment.
ok, if mvnw is listed as the install mechanism, it's a lot simpler to detail as it does the validation. Docs can just say "use an up to date version of maven; the mvnw command will download one and validate it before execution"
| $ sudo apt-get -y install openjdk-17-jdk | ||
| * Maven | ||
| $ sudo apt-get -y install maven | ||
| Most package managers do not install required version of Maven i.e. 3.9.11 or later. |
There was a problem hiding this comment.
Replace with
Do not as of January 2026 install an up to date version of Maven.
| * Maven | ||
| $ sudo apt-get -y install maven | ||
| Most package managers do not install required version of Maven i.e. 3.9.11 or later. | ||
| Following commands download and install Maven manually |
There was a problem hiding this comment.
Use the following commands to download and install Maven manually
|
💔 -1 overall
This message was automatically generated. |
cnauroth
left a comment
There was a problem hiding this comment.
HADOOP-19790 is the last issue marked as a blocker for the 3.5.0 release. @anujmodi2021 , are you able to incorporate Steve's last round of feedback?
Description of PR
Some recent updated done in certain dependencies have caused build failure on older maven versions.
For details refer to JIRA: https://issues.apache.org/jira/browse/HADOOP-19790
With the other upgrades going in 3.5.0, we propose to upgrade the minimum required maven version to the latest stable version i.e. 3.9.12
How was this patch tested?
Negative test: Build failed when attempted with maven version lesser than required.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce (clean) on project hadoop-main: [ERROR] Rule 0: org.apache.maven.enforcer.rules.version.RequireMavenVersion failed with message: [ERROR] Detected Maven Version: 3.9.6 is not in the allowed range [3.9.12,).When attempted buid after upgrading maven to 3.9.12, build was successful
AI Tooling
No AI tools used