* request for help with buildnumber-maven-plugin git integration
@ 2010-05-13 23:22 Adam Monsen
2010-05-27 4:15 ` Adam Monsen
0 siblings, 1 reply; 2+ messages in thread
From: Adam Monsen @ 2010-05-13 23:22 UTC (permalink / raw)
To: git
Justin(?) said, on May 11th:
> Ah yes I also got that. I disabled the "itest"
> section of the pom.
>
> I'll send it to you soon.
>
> Regards
> Justin
Antony Stubbs wrote, on Tue, May 11, 2010 at 12:53 PM:
> I use my build every day, it definitely works for me. However,
> yes, I noticed the failure and disabled the tests! ;) but yes, the
> git integration works fine. I welcome a patch to fix the
> integration tests...
>
> Regards
> Antony
>
> On 12/05/2010, at 4:06, Adam Monsen wrote:
> > Hi there! Sorry to trouble you all. I ran across
> > http://stackoverflow.com/questions/2685069/maven-buildnumber-plugin-git
> > , and it led me to you folks. I'm a software engineer on Mifos.
> >
> > Do any of you have a working version of buildnumber-maven-plugin
> > with git support? I tried building from 14001f of
> > http://github.com/astubbs/buildnumber-maven-plugin/ , but I get
> > an "embedded error". I think an integration test is failing, and
> > I forget how to debug these integration tests. The build passes
> > for me for the upstream code (r11906 of
> > http://svn.codehaus.org/mojo/trunk/mojo/buildnumber-maven-plugin
> > ).
> >
> > Anyway, I'd like to help, let me know if you'd like to
> > collaborate.
(also asked on <users@maven.apache.org>)
Maven is a build system used by many Java-based projects. Some folks
have added Git support, allowing the inclusion of build identifiers
(like branches and commit hashes) in products of Maven builds. But
they need help to complete it. Is anyone interested in helping?
This is something we (Mifos) need, so if you do help, know that
you'll be helping to end world poverty.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: request for help with buildnumber-maven-plugin git integration
2010-05-13 23:22 request for help with buildnumber-maven-plugin git integration Adam Monsen
@ 2010-05-27 4:15 ` Adam Monsen
0 siblings, 0 replies; 2+ messages in thread
From: Adam Monsen @ 2010-05-27 4:15 UTC (permalink / raw)
To: git
I wrote, about a week ago:
> Maven is a build system used by many Java-based projects. Some
> folks have added Git support, allowing the inclusion of build
> identifiers (like branches and commit hashes) in products of Maven
> builds. But they need help to complete it. Is anyone interested in
> helping?
>
> This is something we (Mifos) need, so if you do help, know that
> you'll be helping to end world poverty.
FYI, I gave up trying to fix the integration tests, or to modify the
plugin to suit my needs. I instead used groovy script right in my
POM, and set project properties that are filtered into a file
included in our war.
Here's the Groovy snippet I used, modified to have shorter names to
prevent wrapping:
def env = System.getenv()
def gitcmd = "git"
if (env['OS'] =~ /^Windows/)
gitcmd = "cmd /c ${gitcmd}"
def gcmd = """${gitcmd} log --pretty=format:%H -n1""".execute()
project.properties['mifos_commit'] = gcmd.in.text
project.properties['mifos_build'] = env['BUILD_TAG'] ?: 'DEV'
project.properties['mifos_date'] = "" + new Date()
"BUILD_TAG" is something set by the Hudson continuous integration
server (that's what we use).
Here's the script, in vivo (commit 5dfe4d1abda09713b296ea2524):
http://tinyurl.com/3xcxp9n
I figured trading lots of lines of Java, XML, etc. for 8 lines of
maintainable/portable Groovy was a good move.
Hope this helps someone else using Maven and git who needs build
identifiers available as properties,
-Adam
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-27 4:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-13 23:22 request for help with buildnumber-maven-plugin git integration Adam Monsen
2010-05-27 4:15 ` Adam Monsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).