Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
FLUME-702: Make git hash an argument to the build
The buildnumber plugin fails when attempting to build from a non git repo. This
allows the user to specify a git hash via a -Dbuild.revision argument at the maven
command line.
  • Loading branch information
tucu00 authored and Jonathan Hsieh committed Jul 21, 2011
1 parent e7cfcb7 commit 660eb41
Showing 1 changed file with 9 additions and 26 deletions.
35 changes: 9 additions & 26 deletions flume-core/pom.xml
Expand Up @@ -12,6 +12,9 @@
<name>Flume Core</name> <name>Flume Core</name>
<artifactId>flume-core</artifactId> <artifactId>flume-core</artifactId>


<properties>
<build.revision>NOT AVAILABLE</build.revision>
</properties>
<build> <build>
<plugins> <plugins>


Expand All @@ -35,33 +38,17 @@
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
<!-- this breaks if not in git repo. commented out until resolved -->
<!--
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cloudera-buildnumber-maven-plugin</artifactId>
<version>1.0-beta-5</version>
<configuration>
<fullGitRev>true</fullGitRev>
<timestampFormat>{0, date, E MMM dd HH:mm:ss z yyyy}</timestampFormat>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
-->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version> <version>1.6</version>
<executions> <executions>
<execution> <execution>
<id>generate-version-file</id> <id>generate-version-file</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration> <configuration>
<target> <target>
<copy <copy
Expand All @@ -70,18 +57,14 @@
<fileset dir="${basedir}/src/main/version" /> <fileset dir="${basedir}/src/main/version" />
<filterset begintoken="%" endtoken="%"> <filterset begintoken="%" endtoken="%">
<filter token="VERSION" value="${project.version}" /> <filter token="VERSION" value="${project.version}" />
<filter token="REV" value="${buildNumber}" /> <filter token="REV" value="${build.revision}" />
<filter token="USER" value="${user.name}" /> <filter token="USER" value="${user.name}" />
<filter token="DATE" value="${timestamp}" /> <filter token="DATE" value="${maven.build.timestamp}" />
<filter token="URL" value="${project.scm.url}" /> <filter token="URL" value="${project.scm.url}" />
</filterset> </filterset>
</copy> </copy>
</target> </target>
</configuration> </configuration>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
Expand Down

0 comments on commit 660eb41

Please sign in to comment.