provide scm branch identifier in pom for finer-grained build differentiation
----------------------------------------------------------------------------

                 Key: MOJO-1379
                 URL: http://jira.codehaus.org/browse/MOJO-1379
             Project: Mojo
          Issue Type: New Feature
          Components: buildnumber
    Affects Versions: buildnumber-maven-plugin-1.0-beta-3
            Reporter: Adam Monsen
         Attachments: buildScmBranch.patch

posted first to [email protected] here: http://tinyurl.com/lc6kxy

Howdy,

I needed to fetch the part of an SCM url that provides a location like "trunk" 
or "branches/issue_1820", so I modified buildnumber-maven-plugin. Knowing the 
current branch (or tag) helps distinguish builds since sometimes different SCM 
locations can have the same revision number but have different content.

For instance, in Subversion it is possible to checkout 
http://example.com/svn/trunk or http://example.com/svn/branches/issue_1820 at 
revision "12798" and get entirely different code.

This patch exposes the varible $buildScmBranch as a property, similarly to how 
$buildNumber is currently exposed.

Problems with this patch:
* I probably didn't account for all error conditions properly
* only works with Subversion
* only works with "recommended" directory layout, ie: paths must contain 
"/trunk", "/branches/X", or "/tags/X"
* I didn't do much documentation besides a little Javadoc and an update of the 
"usage" page

This patch was created against SVN revision 9922 from a checkout rooted at 
http://svn.codehaus.org/mojo/trunk/mojo/buildnumber-maven-plugin .

Hope you find this useful too,
-Adam

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to