Bug 613767

Summary: do not perform buildNumber generation based on latest git commit sha unless build files are part of a git working copy
Product: [Other] RHQ Project Reporter: Ian Springer <ian.springer>
Component: Build SystemAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED NOTABUG QA Contact: Mike Foley <mfoley>
Severity: low Docs Contact:
Priority: low    
Version: 1.3.1CC: ccrouch, jshaughn
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-02 19:15:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ian Springer 2010-07-12 19:14:40 UTC
Update the rhq root pom to contain something like the following:

+      <!-- Use buildnumber plugin only if GIT metadata is present. -->
+      <profile>
+         <id>build-number-generation-git</id>
+         <activation> <file> <exists>.git</exists> </file> </activation>
+         <build>
+            <plugins>
+              <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>exec-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-build-number-properties</id>
+                            <phase>generate-resources</phase>
+                            <goals>
+                                <goal>exec</goal>
+                            </goals>
+                            <configuration>
+                                <executable>git</executable>
+                                <arguments>
+                                    <argument>log</argument>
+                                    <argument>--pretty=format:buildNumber = %h</argument>
+                                    <argument>-n1</argument>
+                                </arguments>
+                                <outputFile>${project.build.directory}/build-number.properties</outputFile>
+                            </configuration>
+                        </execution>
+                    </executions>
+              </plugin>
+            </plugins>
+         </build>
+      </profile>

Comment 1 Ian Springer 2010-07-12 19:16:45 UTC
See also https://jira.jboss.org/browse/EMBJOPR-299.

Comment 2 Corey Welton 2010-09-28 12:40:13 UTC
 ips - was this patch ever applied, and if so, which branches?