{"thread":{"id":"23803","subject":"request for help with buildnumber-maven-plugin git integration","startedAt":"2010-05-13T23:22:48Z","lastAt":"2010-05-27T04:15:35Z","messageCount":2,"participants":["Adam Monsen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"141620","messageId":"loom.20100514T010951-900@post.gmane.org","threadId":"23803","inReplyTo":null,"subject":"request for help with buildnumber-maven-plugin git integration","fromName":"Adam Monsen","fromEmail":"haircut@gmail.com","sentAt":"2010-05-13T23:22:48Z","receivedAt":"2010-05-13T23:22:48Z","isPatch":false,"sender":{"key":"haircut@gmail.com","avatar":"https://avatars.githubusercontent.com/u/50639?v=4"},"body":"Justin(?) said, on May 11th:\n> Ah yes I also got that. I disabled the \"itest\"\n> section of the pom.\n> \n> I'll send it to you soon.\n> \n> Regards\n> Justin\n\nAntony Stubbs wrote, on Tue, May 11, 2010 at 12:53 PM:\n> I use my build every day, it definitely works for me. However,\n> yes, I noticed the failure and disabled the tests! ;) but yes, the\n> git integration works fine. I welcome a patch to fix the\n> integration tests...\n> \n> Regards\n> Antony\n> \n> On 12/05/2010, at 4:06, Adam Monsen wrote:\n> > Hi there! Sorry to trouble you all. I ran across\n> > http://stackoverflow.com/questions/2685069/maven-buildnumber-plugin-git\n> > , and it led me to you folks. I'm a software engineer on Mifos.\n> >\n> > Do any of you have a working version of buildnumber-maven-plugin\n> > with git support? I tried building from 14001f of\n> > http://github.com/astubbs/buildnumber-maven-plugin/ , but I get\n> > an \"embedded error\". I think an integration test is failing, and\n> > I forget how to debug these integration tests. The build passes\n> > for me for the upstream code (r11906 of\n> > http://svn.codehaus.org/mojo/trunk/mojo/buildnumber-maven-plugin\n> > ).\n> >\n> > Anyway, I'd like to help, let me know if you'd like to\n> > collaborate.\n\n(also asked on <users@maven.apache.org>)\n\nMaven is a build system used by many Java-based projects. Some folks\nhave added Git support, allowing the inclusion of build identifiers\n(like branches and commit hashes) in products of Maven builds. But\nthey need help to complete it. Is anyone interested in helping?\n\nThis is something we (Mifos) need, so if you do help, know that\nyou'll be helping to end world poverty.\n"},{"id":"142397","messageId":"loom.20100527T061506-817@post.gmane.org","threadId":"23803","inReplyTo":"loom.20100514T010951-900@post.gmane.org","subject":"Re: request for help with buildnumber-maven-plugin git integration","fromName":"Adam Monsen","fromEmail":"haircut@gmail.com","sentAt":"2010-05-27T04:15:35Z","receivedAt":"2010-05-27T04:15:35Z","isPatch":false,"sender":{"key":"haircut@gmail.com","avatar":"https://avatars.githubusercontent.com/u/50639?v=4"},"body":"I wrote, about a week ago:\n> Maven is a build system used by many Java-based projects. Some\n> folks have added Git support, allowing the inclusion of build\n> identifiers (like branches and commit hashes) in products of Maven\n> builds. But they need help to complete it. Is anyone interested in\n> helping?\n>\n> This is something we (Mifos) need, so if you do help, know that\n> you'll be helping to end world poverty.\n\nFYI, I gave up trying to fix the integration tests, or to modify the\nplugin to suit my needs. I instead used groovy script right in my\nPOM, and set project properties that are filtered into a file\nincluded in our war.\n\nHere's the Groovy snippet I used, modified to have shorter names to\nprevent wrapping:\n\n  def env = System.getenv()\n  def gitcmd = \"git\"\n  if (env['OS'] =~ /^Windows/)\n      gitcmd = \"cmd /c ${gitcmd}\"\n  def gcmd = \"\"\"${gitcmd} log --pretty=format:%H -n1\"\"\".execute()\n  project.properties['mifos_commit'] = gcmd.in.text\n  project.properties['mifos_build'] = env['BUILD_TAG'] ?: 'DEV'\n  project.properties['mifos_date'] = \"\" + new Date()\n\n\"BUILD_TAG\" is something set by the Hudson continuous integration\nserver (that's what we use).\n\nHere's the script, in vivo (commit 5dfe4d1abda09713b296ea2524):\nhttp://tinyurl.com/3xcxp9n\n\nI figured trading lots of lines of Java, XML, etc. for 8 lines of\nmaintainable/portable Groovy was a good move.\n\nHope this helps someone else using Maven and git who needs build\nidentifiers available as properties,\n-Adam\n"}]}