diff --git a/hadoop-common-project/hadoop-common/pom.xml b/hadoop-common-project/hadoop-common/pom.xml
index d8e2dd3542223..937015ed66805 100644
--- a/hadoop-common-project/hadoop-common/pom.xml
+++ b/hadoop-common-project/hadoop-common/pom.xml
@@ -1151,7 +1151,7 @@
src-test-compile-protoc-legacy
generate-test-sources
- compile
+ test-compile
false
@@ -1160,7 +1160,7 @@
com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
false
- ${basedir}/src/test/proto
+ ${basedir}/src/test/proto
${project.build.directory}/generated-test-sources/java
false