Skip to content

HADOOP-19790. Updating Minimum Required Maven Version For Hadoop Build#8214

Open
anujmodi2021 wants to merge 5 commits intoapache:trunkfrom
ABFSDriver:HADOOP-19790
Open

HADOOP-19790. Updating Minimum Required Maven Version For Hadoop Build#8214
anujmodi2021 wants to merge 5 commits intoapache:trunkfrom
ABFSDriver:HADOOP-19790

Conversation

@anujmodi2021
Copy link
Contributor

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

@anujmodi2021
Copy link
Contributor Author

Hi @steveloughran @cnauroth

Here is a small patch for changing the min required maven version.
I chose 3.9.12. Let me know if you prefer any other.

Also please let me know if any additional testig is needed.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 22m 2s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+0 🆗 xmllint 0m 1s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 47m 49s trunk passed
+1 💚 compile 19m 11s trunk passed with JDK Ubuntu-21.0.7+6-Ubuntu-0ubuntu120.04
+1 💚 compile 19m 31s trunk passed with JDK Ubuntu-17.0.15+6-Ubuntu-0ubuntu120.04
-1 ❌ mvnsite 10m 20s /branch-mvnsite-root.txt root in trunk failed.
-1 ❌ javadoc 9m 1s /branch-javadoc-root-jdkUbuntu-21.0.7+6-Ubuntu-0ubuntu120.04.txt root in trunk failed with JDK Ubuntu-21.0.7+6-Ubuntu-0ubuntu120.04.
-1 ❌ javadoc 8m 24s /branch-javadoc-root-jdkUbuntu-17.0.15+6-Ubuntu-0ubuntu120.04.txt root in trunk failed with JDK Ubuntu-17.0.15+6-Ubuntu-0ubuntu120.04.
+1 💚 shadedclient 149m 25s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
-1 ❌ mvninstall 0m 15s /patch-mvninstall-root.txt root in the patch failed.
-1 ❌ compile 0m 14s /patch-compile-root-jdkUbuntu-21.0.7+6-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-21.0.7+6-Ubuntu-0ubuntu120.04.
-1 ❌ javac 0m 14s /patch-compile-root-jdkUbuntu-21.0.7+6-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-21.0.7+6-Ubuntu-0ubuntu120.04.
-1 ❌ compile 0m 14s /patch-compile-root-jdkUbuntu-17.0.15+6-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-17.0.15+6-Ubuntu-0ubuntu120.04.
-1 ❌ javac 0m 14s /patch-compile-root-jdkUbuntu-17.0.15+6-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-17.0.15+6-Ubuntu-0ubuntu120.04.
+1 💚 blanks 0m 0s The patch has no blanks issues.
-1 ❌ mvnsite 0m 14s /patch-mvnsite-root.txt root in the patch failed.
-1 ❌ javadoc 0m 14s /patch-javadoc-root-jdkUbuntu-21.0.7+6-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-21.0.7+6-Ubuntu-0ubuntu120.04.
-1 ❌ javadoc 0m 14s /patch-javadoc-root-jdkUbuntu-17.0.15+6-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-17.0.15+6-Ubuntu-0ubuntu120.04.
-1 ❌ shadedclient 2m 6s patch has errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 0m 14s /patch-unit-root.txt root in the patch failed.
+1 💚 asflicense 0m 27s The patch does not generate ASF License warnings.
177m 48s
Subsystem Report/Notes
Docker ClientAPI=1.53 ServerAPI=1.53 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8214/1/artifact/out/Dockerfile
GITHUB PR #8214
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint
uname Linux 4fee76af2d3e 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 951ac4b
Default Java Ubuntu-17.0.15+6-Ubuntu-0ubuntu120.04
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.7+6-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.15+6-Ubuntu-0ubuntu120.04
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8214/1/testReport/
Max. process+thread count 658 (vs. ulimit of 5500)
modules C: . U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8214/1/console
versions git=2.25.1 maven=3.9.11
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@pan3793
Copy link
Member

pan3793 commented Jan 29, 2026

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
Copy link
Member

Choose a reason for hiding this comment

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

even ubuntu 24.04 apt repo installs old maven 3.8.7, let's just replace it with manual install commands

@github-actions github-actions bot added the Infra label Jan 29, 2026
@anujmodi2021
Copy link
Contributor Author

Thanks a lot for your review @pan3793 and pointing out missed spots in the upgrade.
I strongly agree with your suggestion to go with a version that will be as seemless as possible.

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add maven installation commands as well ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Taken

Copy link
Contributor

Choose a reason for hiding this comment

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

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
Comment on lines 66 to 67
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
Copy link
Member

@pan3793 pan3793 Jan 29, 2026

Choose a reason for hiding this comment

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

let's replace this with the real commands

Suggested change
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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No issues, thanks for checking.
I have made the changes

BUILDING.txt Outdated
Comment on lines 71 to 76
$ 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
Copy link
Member

Choose a reason for hiding this comment

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

below setup is unnecessary if we create a soft link /usr/bin/mvn, please keep things simple

Suggested change
$ 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

Copy link
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

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

LGTM, except for a minor comment

@anujmodi2021
Copy link
Contributor Author

LGTM, except for a minor comment

Thanks for your review @pan3793
I have taken your comment. Will wait for some more time to allow other committers to pitch in before merging this.

Copy link
Contributor

@steveloughran steveloughran left a comment

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

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.asc

Copy link
Member

@pan3793 pan3793 Jan 30, 2026

Choose a reason for hiding this comment

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

@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)

Copy link
Contributor

Choose a reason for hiding this comment

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

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the following commands to download and install Maven manually

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 1m 19s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 49m 15s trunk passed
+1 💚 compile 18m 57s trunk passed with JDK Ubuntu-21.0.7+6-Ubuntu-0ubuntu120.04
+1 💚 compile 19m 27s trunk passed with JDK Ubuntu-17.0.15+6-Ubuntu-0ubuntu120.04
-1 ❌ mvnsite 10m 7s /branch-mvnsite-root.txt root in trunk failed.
-1 ❌ javadoc 9m 4s /branch-javadoc-root-jdkUbuntu-21.0.7+6-Ubuntu-0ubuntu120.04.txt root in trunk failed with JDK Ubuntu-21.0.7+6-Ubuntu-0ubuntu120.04.
-1 ❌ javadoc 8m 24s /branch-javadoc-root-jdkUbuntu-17.0.15+6-Ubuntu-0ubuntu120.04.txt root in trunk failed with JDK Ubuntu-17.0.15+6-Ubuntu-0ubuntu120.04.
+1 💚 shadedclient 148m 17s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 43m 16s the patch passed
+1 💚 compile 18m 45s the patch passed with JDK Ubuntu-21.0.7+6-Ubuntu-0ubuntu120.04
+1 💚 javac 18m 45s the patch passed
+1 💚 compile 19m 28s the patch passed with JDK Ubuntu-17.0.15+6-Ubuntu-0ubuntu120.04
+1 💚 javac 19m 28s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-1 ❌ mvnsite 8m 11s /patch-mvnsite-root.txt root in the patch failed.
-1 ❌ javadoc 8m 52s /patch-javadoc-root-jdkUbuntu-21.0.7+6-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-21.0.7+6-Ubuntu-0ubuntu120.04.
-1 ❌ javadoc 8m 26s /patch-javadoc-root-jdkUbuntu-17.0.15+6-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-17.0.15+6-Ubuntu-0ubuntu120.04.
+1 💚 shadedclient 60m 46s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 821m 48s /patch-unit-root.txt root in the patch passed.
+1 💚 asflicense 1m 50s The patch does not generate ASF License warnings.
1118m 59s
Reason Tests
Failed junit tests hadoop.yarn.server.resourcemanager.webapp.TestRMWebServicesReservation
hadoop.yarn.server.resourcemanager.TestRMHA
hadoop.yarn.server.router.subcluster.fair.TestYarnFederationWithFairScheduler
hadoop.yarn.service.TestYarnNativeServices
hadoop.yarn.sls.appmaster.TestAMSimulator
hadoop.hdfs.TestRollingUpgrade
hadoop.hdfs.tools.TestDFSAdmin
Subsystem Report/Notes
Docker ClientAPI=1.53 ServerAPI=1.53 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8214/2/artifact/out/Dockerfile
GITHUB PR #8214
Optional Tests dupname asflicense codespell detsecrets compile javac javadoc mvninstall mvnsite unit shadedclient xmllint
uname Linux 18db8748e058 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / d0865fb
Default Java Ubuntu-17.0.15+6-Ubuntu-0ubuntu120.04
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.7+6-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.15+6-Ubuntu-0ubuntu120.04
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8214/2/testReport/
Max. process+thread count 3582 (vs. ulimit of 5500)
modules C: . U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8214/2/console
versions git=2.25.1 maven=3.9.11
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@steveloughran steveloughran left a comment

Choose a reason for hiding this comment

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

commented.

Copy link
Contributor

@cnauroth cnauroth left a comment

Choose a reason for hiding this comment

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

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants