Add maven-replacer-plugin to set value in version.json 32/90732/5
authorIttay Stern <ittay.stern@att.com>
Mon, 1 Jul 2019 14:40:20 +0000 (17:40 +0300)
committerIttay Stern <ittay.stern@att.com>
Mon, 1 Jul 2019 17:08:54 +0000 (20:08 +0300)
Issue-ID: VID-507

Change-Id: Iab08d9da4352b159a4dce550188af973bd55edfc
Signed-off-by: Ittay Stern <ittay.stern@att.com>
vid-app-common/pom.xml

index d8c1a08..6a48190 100755 (executable)
@@ -48,6 +48,9 @@
         <eirslett.version>1.6</eirslett.version>
         <node.version>v6.16.0</node.version>
 
+        <!-- override using -Drelease_version=foo -Dpatch_version=bar -->
+        <release_version>${env.RELEASE_VERSION}</release_version>
+        <patch_version/>
     </properties>
 
 
 
             </plugin>
 
+            <plugin>
+                <groupId>com.google.code.maven-replacer-plugin</groupId>
+                <artifactId>replacer</artifactId>
+                <version>1.5.3</version>
+                <executions>
+                    <execution>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>replace</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <regex>false</regex>
+                    <file>${project.basedir}/src/main/webapp/app/vid/scripts/constants/version.json</file>
+                    <replacements>
+                        <replacement>
+                            <token>BUILD_NUMBER</token>
+                            <value>${release_version}.${patch_version}.${env.BUILD_NUMBER}</value>
+                        </replacement>
+                    </replacements>
+                </configuration>
+            </plugin>
+
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>