HBASE-21842 Properly use flatten-maven-plugin in hbase-connectors
authorBalazs Meszaros <balazs.meszaros@cloudera.com>
Tue, 5 Feb 2019 14:15:55 +0000 (15:15 +0100)
committermeszibalu <github@bali.budape.st>
Wed, 13 Feb 2019 11:44:04 +0000 (12:44 +0100)
flatten-maven-plugin has been moved from <pluginManagement> to <plugins>.
After doing an mvn install, it replaces ${revison} in <parent> section to
the actual version. Other variable substitutions are untouched.

.gitignore
hbase-connectors-assembly/pom.xml
hbase-connectors-assembly/src/main/assembly/hbase-connectors-bin.xml
kafka/pom.xml
pom.xml
spark/hbase-spark-it/pom.xml
spark/pom.xml

index 0fce7d4..cf0df74 100644 (file)
@@ -15,6 +15,7 @@ hbase-*/test
 *.ipr
 patchprocess/
 dependency-reduced-pom.xml
+.flattened-pom.xml
 link_report/
 linklint-*.zip
 linklint/
index 6e581ab..d695975 100755 (executable)
@@ -25,6 +25,7 @@
     <artifactId>hbase-connectors</artifactId>
     <groupId>org.apache.hbase.connectors</groupId>
     <version>${revision}</version>
+    <relativePath>../</relativePath>
   </parent>
   <artifactId>hbase-connectors-assembly</artifactId>
   <name>Apache HBase Connectors - Assembly</name>
     <dependency>
       <groupId>org.apache.hbase.connectors.kafka</groupId>
       <artifactId>hbase-kafka-proxy</artifactId>
-      <version>${project.version}</version>
+      <version>${revision}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.hbase.connectors.kafka</groupId>
       <artifactId>hbase-kafka-model</artifactId>
-      <version>${project.version}</version>
+      <version>${revision}</version>
     </dependency>
   </dependencies>
   <build>
@@ -59,7 +60,7 @@
               <goal>single</goal>
             </goals>
             <configuration>
-              <finalName>hbase-connectors-${project.version}</finalName>
+              <finalName>hbase-connectors-${revision}</finalName>
               <skipAssembly>false</skipAssembly>
               <appendAssemblyId>true</appendAssemblyId>
               <tarLongFileMode>gnu</tarLongFileMode>
index d57fbd4..3e2472b 100755 (executable)
@@ -26,7 +26,7 @@
   <formats>
     <format>tar.gz</format>
   </formats>
-  <baseDirectory>hbase-connectors-${project.version}</baseDirectory>
+  <baseDirectory>hbase-connectors-${revision}</baseDirectory>
   <componentDescriptors>
       <componentDescriptor>src/main/assembly/connector-components.xml</componentDescriptor>
   </componentDescriptors>
index 881459a..a829e06 100644 (file)
@@ -48,7 +48,7 @@
       <dependency>
         <groupId>org.apache.hbase.connectors.kafka</groupId>
         <artifactId>hbase-kafka-model</artifactId>
-        <version>${project.version}</version>
+        <version>${revision}</version>
       </dependency>
     </dependencies>
   </dependencyManagement>
diff --git a/pom.xml b/pom.xml
index 95112de..dbafab9 100755 (executable)
--- a/pom.xml
+++ b/pom.xml
     </extensions>
     <pluginManagement>
       <plugins>
-        <!-- See https://maven.apache.org/maven-ci-friendly.html-->
-        <plugin>
-          <groupId>org.codehaus.mojo</groupId>
-          <artifactId>flatten-maven-plugin</artifactId>
-          <version>1.0.1</version>
-          <configuration>
-            <updatePomFile>true</updatePomFile>
-          </configuration>
-          <executions>
-            <execution>
-              <id>flatten</id>
-              <phase>process-resources</phase>
-              <goals>
-                <goal>flatten</goal>
-              </goals>
-            </execution>
-            <execution>
-              <id>flatten.clean</id>
-              <phase>clean</phase>
-              <goals>
-                <goal>clean</goal>
-              </goals>
-            </execution>
-          </executions>
-        </plugin>
         <plugin>
           <artifactId>maven-assembly-plugin</artifactId>
           <configuration>
           </execution>
         </executions>
       </plugin>
+      <!-- See https://maven.apache.org/maven-ci-friendly.html-->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>flatten-maven-plugin</artifactId>
+        <version>1.1.0</version>
+        <configuration>
+          <updatePomFile>true</updatePomFile>
+          <flattenMode>resolveCiFriendliesOnly</flattenMode>
+        </configuration>
+        <executions>
+          <execution>
+            <id>flatten</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>flatten</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>flatten.clean</id>
+            <phase>clean</phase>
+            <goals>
+              <goal>clean</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
   <profiles>
index f098c84..36cb2e0 100644 (file)
     <dependency>
       <groupId>org.apache.hbase.connectors.spark</groupId>
       <artifactId>hbase-spark</artifactId>
-      <version>${project.version}</version>
+      <version>${revision}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.hbase</groupId>
index a5dcaaf..58a2ac7 100644 (file)
@@ -53,7 +53,7 @@
       <dependency>
         <groupId>org.apache.hbase.connectors.spark</groupId>
         <artifactId>hbase-spark</artifactId>
-        <version>${project.version}</version>
+        <version>${revision}</version>
       </dependency>
       <dependency>
         <groupId>org.apache.hbase.thirdparty</groupId>