Support defining version in parent pom only (#25) branch-2.7
authorOlivér Sz <oleewere@gmail.com>
Fri, 28 Dec 2018 12:03:18 +0000 (13:03 +0100)
committerGitHub <noreply@github.com>
Fri, 28 Dec 2018 12:03:18 +0000 (13:03 +0100)
* Support defining version in parent pom only

* Add install task to makefile

.gitignore
Makefile
ambari-infra-assembly/pom.xml
ambari-infra-manager-it/pom.xml
ambari-infra-manager/pom.xml
ambari-infra-solr-client/pom.xml
ambari-infra-solr-plugin/pom.xml
pom.xml

index 2dcdfeaf1e76059e32ec96774b4e4514d7b85b18..31885d96900e91ac83bd352045e8ef074d9f216c 100644 (file)
@@ -15,4 +15,5 @@
 derby.log
 pass.txt
 out
-job-repository.db
\ No newline at end of file
+job-repository.db
+.flattened-pom.xml
\ No newline at end of file
index 76af8f33e708d14aa9b384941c66ffdbb9cb0ed8..d6b7bdf99268d381ddc97c6b1865a296a3e49e6a 100644 (file)
--- a/Makefile
+++ b/Makefile
 GIT_REV_SHORT = $(shell git rev-parse --short HEAD)
 MAVEN_BINARY ?= mvn
 
+ifeq ("$(INFRA_JDK_11)", "true")
+  INFRA_JAVA_VERSION = "11"
+else
+  INFRA_JAVA_VERSION = "1.8"
+endif
+
 package:
-       $(MAVEN_BINARY) clean package
+       $(MAVEN_BINARY) clean package -Djdk.version=$(INFRA_JAVA_VERSION)
+
+install:
+       $(MAVEN_BINARY) clean install -Djdk.version=$(INFRA_JAVA_VERSION)
 
 test:
-       $(MAVEN_BINARY) clean test
+       $(MAVEN_BINARY) clean test -Djdk.version=$(INFRA_JAVA_VERSION)
 
 update-version:
-       $(MAVEN_BINARY) versions:set -DnewVersion=$(new-version) -DgenerateBackupPoms=false
+       $(MAVEN_BINARY) versions:set-property -Dproperty=revision -DnewVersion=$(new-version) -DgenerateBackupPoms=false -Djdk.version=$(INFRA_JAVA_VERSION)
 
 rpm:
-       $(MAVEN_BINARY) clean package -Dbuild-rpm -DskipTests
+       $(MAVEN_BINARY) clean package -Dbuild-rpm -DskipTests -Djdk.version=$(INFRA_JAVA_VERSION)
 
 deb:
-       $(MAVEN_BINARY) clean package -Dbuild-deb -DskipTests
+       $(MAVEN_BINARY) clean package -Dbuild-deb -DskipTests -Djdk.version=$(INFRA_JAVA_VERSION)
 
 docker-build:
-       $(MAVEN_BINARY) clean package docker:build -DskipTests -Dbuild-deb
+       $(MAVEN_BINARY) clean package docker:build -DskipTests -Dbuild-deb -Djdk.version=$(INFRA_JAVA_VERSION)
 
 docker-push:
-       $(MAVEN_BINARY) clean package docker:build docker:push -DskipTests -Dbuild-deb
+       $(MAVEN_BINARY) clean package docker:build docker:push -DskipTests -Dbuild-deb -Djdk.version=$(INFRA_JAVA_VERSION)
index ef9953c499b71edca80afdc36c5a91f60b891884..ef5ddc4f82169a1181e0aea9183b5f3123973da1 100644 (file)
@@ -21,7 +21,7 @@
   <parent>
     <artifactId>ambari-infra</artifactId>
     <groupId>org.apache.ambari</groupId>
-    <version>2.0.0.0-SNAPSHOT</version>
+    <version>${revision}</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>ambari-infra-assembly</artifactId>
index db4ca9c16193f655e5818d4e60be615078af0a68..5edab8aabe5aa284d842776bc45565f001259316 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>ambari-infra</artifactId>
     <groupId>org.apache.ambari</groupId>
-    <version>2.0.0.0-SNAPSHOT</version>
+    <version>${revision}</version>
   </parent>
 
   <name>Ambari Infra Manager Integration Tests</name>
index 80dddb1fd3febeb8e6c100c87fc10deac63aab57..d821cd53b897e48d2299e1f88765238ddc77501e 100644 (file)
@@ -21,7 +21,7 @@
   <parent>
     <artifactId>ambari-infra</artifactId>
     <groupId>org.apache.ambari</groupId>
-    <version>2.0.0.0-SNAPSHOT</version>
+    <version>${revision}</version>
   </parent>
   <name>Ambari Infra Manager</name>
   <url>http://maven.apache.org</url>
index a4abc9aaf73d78c393787e73df4d991931e6b85c..1401eecd72c6d49e6a9d2e13103034204c587e7e 100644 (file)
@@ -21,7 +21,7 @@
   <parent>
     <artifactId>ambari-infra</artifactId>
     <groupId>org.apache.ambari</groupId>
-    <version>2.0.0.0-SNAPSHOT</version>
+    <version>${revision}</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <url>http://maven.apache.org</url>
index e9bec0864469aa81e0b32d1790d6498ae0d8663c..516b582c928ea46ff83594ffe77845fa8b0f4566 100644 (file)
@@ -21,7 +21,7 @@
   <parent>
     <artifactId>ambari-infra</artifactId>
     <groupId>org.apache.ambari</groupId>
-    <version>2.0.0.0-SNAPSHOT</version>
+    <version>${revision}</version>
   </parent>
   <name>Ambari Infra Solr Plugin</name>
   <url>http://maven.apache.org</url>
diff --git a/pom.xml b/pom.xml
index 5791f3900357230dfcd99ba390fa0a068f0c0e0e..2941b5590541257ac8cd2a4ef66ff340d3d77385 100644 (file)
--- a/pom.xml
+++ b/pom.xml
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.ambari</groupId>
   <artifactId>ambari-infra</artifactId>
-  <version>2.0.0.0-SNAPSHOT</version>
+  <version>${revision}</version>
   <packaging>pom</packaging>
 
   <properties>
+    <revision>3.0.0.0-SNAPSHOT</revision>
     <jdk.version>1.8</jdk.version>
     <solr.version>7.6.0</solr.version>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
       </plugins>
     </pluginManagement>
     <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>flatten-maven-plugin</artifactId>
+        <version>1.0.0</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>
         <inherited>false</inherited>
         <artifactId>maven-assembly-plugin</artifactId>