AVRO-2850: Configure Hadoop 2 tests execution for backwards compatibility
diff --git a/lang/java/build.sh b/lang/java/build.sh
index 88847ea..96fdb34 100755
--- a/lang/java/build.sh
+++ b/lang/java/build.sh
@@ -32,8 +32,8 @@
         ;;
       test)
         mvn -B test
-        # Test the modules that depend on hadoop using Hadoop 3
-        mvn -B test -Phadoop3
+        # Test the modules that depend on hadoop using Hadoop 2
+        mvn -B test -Phadoop2
         ;;
       dist)
         mvn -P dist package -DskipTests javadoc:aggregate
diff --git a/lang/java/pom.xml b/lang/java/pom.xml
index 5eb4058..def5ee1 100644
--- a/lang/java/pom.xml
+++ b/lang/java/pom.xml
@@ -478,10 +478,11 @@
         </plugins>
       </build>
     </profile>
+    <!-- This profile is used on tests to validate backwards compatibility with Hadoop 2 -->
     <profile>
-      <id>hadoop3</id>
+      <id>hadoop2</id>
       <properties>
-        <hadoop.version>3.2.1</hadoop.version>
+        <hadoop.version>2.7.7</hadoop.version>
       </properties>
     </profile>
   </profiles>