properties cannot be used where they will affect the build plan.

Therefore the following xpaths are not allowed (it may appear to work,
but it will blow up in your face when you are not looking)

/project/parent/*
/project/groupId
/project/artifactId
/project/version

almost anywhere else is fair game

On 7 March 2012 15:18, Seth Call <[email protected]> wrote:
> Hi Roy,
>
> I don't understand what 'tagging our repo' means.  Is this a feature of
> your remote repository?  Sorry... I googled but I don't know what you are
> saying...
>
> But aside from that, I really don't care about git hash in this question...
> let me explain what I'm trying to acheive...
>
>
>
> As a developer:
> * If I'm on branch master, I want my project version to be master-SNAPSHOT
>
> * If I'm on branch development, I want my project version to be
> development-SNAPSHOT
>
> I'd like that to happen automatically when I make the branch; I know this
> is rather dynamic so I assume a plugin at a minimum is required.   I'm also
> not interested in using git local hooks if at all avoidable because they
> have their own drawbacks.
>
> This versioning scheme is very important; making a branch is making a new
> version.  So, downstream projects that depend on my project:master-SNAPSHOT
> should *not* pickup my new branch's build artifact-not unless, of course, I
> go to that downstream project and change it's dependency version to say
> project:development-SNAPSHOT.
>
> In summary, they are different versions, and so if you don't version your
> project as you make a branch, then you will now have indeterminate build
> resolution because 'the-last-branch-you-build-will-win' sort of problems.
>  Also, all of this should work locally (not require a build server), so I'm
> limiting myself to maven-only techniques...
>
> Any help is greatly appreciated.  I hope there is some way to achieve this
> that I'm just not thinking of...
>
> But if anyone can say definitively that you can not put a variable in the
> <version> tag of an artifact, then I at least know a plugin-based solution
> is not an option.
>
> Regards,
> Seth
>
> On Wed, Mar 7, 2012 at 6:00 AM, Lyons, Roy [via Maven] <
> [email protected]> wrote:
>
>> :-) we tag our repo with "branchname!RP-BL-mavenlabel" to help in
>> location.  Rp is for release prepare and bl is for baseline (carryover from
>> clearcase terminology)
>>
>> Just remember that in git a hash doesn't belong to a branch, it is simply
>> attached to a linked list of hashes.  A "branch" is simply a tag pointing
>> to a hash being designated as a "head".  You can just as easily use the tag
>> created by the release plugin to checkout, and then make some bugfix branch
>> from that location.
>>
>>
>> Sent from my Blackberry.
>>
>> ----- Original Message -----
>> From: Seth Call <[hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=5543915&i=0>>
>>
>> To: [hidden email] 
>> <http://user/SendEmail.jtp?type=node&node=5543915&i=1><[hidden
>> email] <http://user/SendEmail.jtp?type=node&node=5543915&i=2>>
>> Sent: Tue Mar 06 22:01:07 2012
>> Subject: Is it possible to tie current git branch to project version?
>>
>> Hi there,
>>
>> I've seen indication when searching the internet that it isn't possible to
>> put variables in <version> of a project (unless those variables are
>> hardcoded <properties> or provided at the command line), but I thought I'd
>> ask the list ...
>>
>> Say there was a plugin that would invoke 'git branch' to determine the
>> current branch, and to then make that available to the project as a
>> variable; call it ${branch}.   I'd like to use this variable then in the
>> version tag:
>>
>> <project>
>> <groupId>blah</groupId>
>> <artifactId>blah</artifactId>
>> <version>${branch}-SNAPSHOT</version>
>> </project>
>>
>> The reason I want to do this is that I'm realizing, for our internal-only
>> code projects, that a branch is always synonymous with a version of a
>> project, and ideally the act of being of switching branches would be all
>> it
>> takes to switch your maven project's version.
>>
>> Is this possible if I were to make a maven plugin?
>>
>> Thanks!
>> Seth
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://maven.40175.n5.nabble.com/Is-it-possible-to-tie-current-git-branch-to-project-version-tp5543110p5543110.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=5543915&i=3>
>> For additional commands, e-mail: [hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=5543915&i=4>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=5543915&i=5>
>> For additional commands, e-mail: [hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=5543915&i=6>
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://maven.40175.n5.nabble.com/Is-it-possible-to-tie-current-git-branch-to-project-version-tp5543110p5543915.html
>>  To unsubscribe from Is it possible to tie current git branch to project
>> version?, click 
>> here<http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5543110&code=c2V0aGNhbGxAZ21haWwuY29tfDU1NDMxMTB8LTU5NTg4MjI5Nw==>
>> .
>> NAML<http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
> --
> View this message in context: 
> http://maven.40175.n5.nabble.com/Is-it-possible-to-tie-current-git-branch-to-project-version-tp5543110p5544417.html
> Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to