Bug 613767 - do not perform buildNumber generation based on latest git commit sha unless build files are part of a git working copy
Summary: do not perform buildNumber generation based on latest git commit sha unless b...
Status: CLOSED NOTABUG
Alias: None
Product: RHQ Project
Classification: Other
Component: Build System   
(Show other bugs)
Version: 1.3.1
Hardware: All
OS: All
low
low vote
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-12 19:14 UTC by Ian Springer
Modified: 2014-06-02 19:15 UTC (History)
2 users (show)

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: ---


Attachments (Terms of Use)

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?


Note You need to log in before you can comment on or make changes to this bug.