HTRACE-398: Enforce requirement to build with Maven 3.0.4 from HTRACE-236
diff --git a/BUILDING.txt b/BUILDING.txt
index ad8ef12..5407fa2 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -4,7 +4,7 @@
 Building HTrace requires
 
 * Java 1.7 at least.
-* Apache Maven 3.x
+* Apache Maven 3.0.4
 * Go programming language, version 1.4 or higher (for htrace-htraced)
 * The development package for leveldb (for htrace-htraced)
 
diff --git a/pom.xml b/pom.xml
index fcdb469..8552935 100644
--- a/pom.xml
+++ b/pom.xml
@@ -122,6 +122,27 @@
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-enforcer-plugin</artifactId>
+          <version>${maven-enforcer-plugin.version}</version>
+          <executions>
+            <execution>
+              <id>enforce-maven</id>
+              <goals>
+                <goal>enforce</goal>
+              </goals>
+              <configuration>
+                <rules>
+                  <requireMavenVersion>
+                    <version>[3.0.4]</version>
+		    <message>Maven 3.0.4 is required, see HTRACE-236</message>
+		  </requireMavenVersion>
+		</rules>
+	      </configuration>
+            </execution>
+          </executions>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-jar-plugin</artifactId>
           <version>${maven-jar-plugin.version}</version>
           <executions>
@@ -220,6 +241,10 @@
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-gpg-plugin</artifactId>
       </plugin>
       <plugin>
@@ -276,6 +301,7 @@
   <properties>
     <targetJdk>1.7</targetJdk>
     <failIfNoTests>false</failIfNoTests>
+    <maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>
     <maven-source-plugin.version>2.1.2</maven-source-plugin.version>
     <maven-javadoc-plugin.version>2.8.1</maven-javadoc-plugin.version>
     <maven-jar-plugin.version>2.4</maven-jar-plugin.version>