maven release plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

maven release plugin

Matthew Broadhead
hi,
not sure if this is the correct place to ask questions about the maven
release plugin
i am trying to set my snapshots and releases properly
i am using git with a master branch and a development branch
how do i work in the snapshot on development and then tag the releases
to master?
if you know any good tutorials online that would help as i tried a few
but they didn't fit my case

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

Reply | Threaded
Open this post in threaded view
|

Re: maven release plugin

Ben Tatham-3
Sounds like you're using gitflow (master, develop, feature/* branches).  If
so, we use the jgitflow-maven-plugin instead of maven-release-plugin, which
handles these transitions and the inherent conflicts caused by the maven
versioning.

Unfortunately, the maintainer is no longer working on it (and says he's not
even working in java anymore), but it still works well.

https://bitbucket.org/atlassian/jgit-flow/wiki/Home

On Wed, Feb 28, 2018 at 7:18 AM Matthew Broadhead <
[hidden email]> wrote:

> hi,
> not sure if this is the correct place to ask questions about the maven
> release plugin
> i am trying to set my snapshots and releases properly
> i am using git with a master branch and a development branch
> how do i work in the snapshot on development and then tag the releases
> to master?
> if you know any good tutorials online that would help as i tried a few
> but they didn't fit my case
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
> --
--
Ben Tatham
Software Architect

*Nano**metrics* *Inc.*

Ottawa * I*  Calgary  *I*  Houston  *I*  Beijing

T: +1 613 505 5065  *I*  [hidden email]
 www.nanometrics.ca  *I  *www.microseismicmonitoring.com

This message is intended exclusively for the individual or entity to which
it is addressed. This communication may contain information that is
proprietary, privileged, confidential or otherwise legally exempt from
disclosure. If you are not the named addressee, or have been inadvertently
and erroneously referenced in the address line, you are not authorized to
read, print, retain, copy or disseminate this message or any part of it. If
you have received this message in error, please notify the sender
immediately by e-mail and delete all copies of the message.
Reply | Threaded
Open this post in threaded view
|

Re: maven release plugin

Matthew Broadhead
thanks Ben that looks just the job

On 28/02/2018 14:56, Ben Tatham wrote:

> Sounds like you're using gitflow (master, develop, feature/* branches).  If
> so, we use the jgitflow-maven-plugin instead of maven-release-plugin, which
> handles these transitions and the inherent conflicts caused by the maven
> versioning.
>
> Unfortunately, the maintainer is no longer working on it (and says he's not
> even working in java anymore), but it still works well.
>
> https://bitbucket.org/atlassian/jgit-flow/wiki/Home
>
> On Wed, Feb 28, 2018 at 7:18 AM Matthew Broadhead <
> [hidden email]> wrote:
>
>> hi,
>> not sure if this is the correct place to ask questions about the maven
>> release plugin
>> i am trying to set my snapshots and releases properly
>> i am using git with a master branch and a development branch
>> how do i work in the snapshot on development and then tag the releases
>> to master?
>> if you know any good tutorials online that would help as i tried a few
>> but they didn't fit my case
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>> --


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

Reply | Threaded
Open this post in threaded view
|

Re: maven release plugin

Mark Derricutt
In reply to this post by Ben Tatham-3

On 1 Mar 2018, at 2:56, Ben Tatham wrote:

Sounds like you're using gitflow (master, develop, feature/* branches). If
so, we use the jgitflow-maven-plugin instead of maven-release-plugin, which
handles these transitions and the inherent conflicts caused by the maven
versioning.

Unfortunately, the maintainer is no longer working on it (and says he's not
even working in java anymore), but it still works well.

For my own git-flow based releases I have the following git-mvnrelease script I have on the path:

#!/bin/sh
if ! git diff-index --quiet HEAD --; then
    echo "Git is dirty, clean up your mess!"
    exit 1
fi

VERSION=`xml sel -N x="http://maven.apache.org/POM/4.0.0" -t -v "/x:project/x:version" pom.xml`
BASEVERSION=${VERSION%-SNAPSHOT}
ARTIFACTID=`xml sel -N x="http://maven.apache.org/POM/4.0.0" -t -v "/x:project/x:artifactId" pom.xml`

echo "Removing non-scm files..."
git clean -fdi

echo "Checking master branch for updates..."
git checkout master
git pull origin master

git flow release start $BASEVERSION && mvn release:prepare release:perform && git flow release finish -n $BASEVERSION && git push origin && git push origin --tags 

This first checks my working directory is clean, just for safety, extracts the pom.xml version for use in branch/tag names. Switches to my master branch and makes sure it's up to date, then does a batch release/push.

I don't think I've ever had any issues with maven versioning, unless the version number as part of the release/merge has changed to something unexpected.

YMMV
Mark


"The ease with which a change can be implemented has no relevance at all to whether it is the right change for the (Java) Platform for all time." — Mark Reinhold.

Mark Derricutt
http://www.theoryinpractice.net
http://www.chaliceofblood.net
http://plus.google.com/+MarkDerricutt
http://twitter.com/talios
http://facebook.com/mderricutt


signature.asc (546 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: maven release plugin

Stephen Coy-4
In reply to this post by Ben Tatham-3
I have been using https://github.com/aleksandr-m/gitflow-maven-plugin <https://github.com/aleksandr-m/gitflow-maven-plugin> and found that it works quite sweetly.

… and it is being actively maintained.

Cheers,

Steve C

> On 1 Mar 2018, at 12:56 am, Ben Tatham <[hidden email]> wrote:
>
> Sounds like you're using gitflow (master, develop, feature/* branches).  If
> so, we use the jgitflow-maven-plugin instead of maven-release-plugin, which
> handles these transitions and the inherent conflicts caused by the maven
> versioning.
>
> Unfortunately, the maintainer is no longer working on it (and says he's not
> even working in java anymore), but it still works well.
>
> https://bitbucket.org/atlassian/jgit-flow/wiki/Home
>
> On Wed, Feb 28, 2018 at 7:18 AM Matthew Broadhead <
> [hidden email]> wrote:
>
>> hi,
>> not sure if this is the correct place to ask questions about the maven
>> release plugin
>> i am trying to set my snapshots and releases properly
>> i am using git with a master branch and a development branch
>> how do i work in the snapshot on development and then tag the releases
>> to master?
>> if you know any good tutorials online that would help as i tried a few
>> but they didn't fit my case
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>> --
> --
> Ben Tatham
> Software Architect
>
> *Nano**metrics* *Inc.*
>
> Ottawa * I*  Calgary  *I*  Houston  *I*  Beijing
>
> T: +1 613 505 5065  *I*  [hidden email]
> www.nanometrics.ca  *I  *www.microseismicmonitoring.com
>
> This message is intended exclusively for the individual or entity to which
> it is addressed. This communication may contain information that is
> proprietary, privileged, confidential or otherwise legally exempt from
> disclosure. If you are not the named addressee, or have been inadvertently
> and erroneously referenced in the address line, you are not authorized to
> read, print, retain, copy or disseminate this message or any part of it. If
> you have received this message in error, please notify the sender
> immediately by e-mail and delete all copies of the message.

Reply | Threaded
Open this post in threaded view
|

Re: maven release plugin

Matthew Broadhead
In reply to this post by Mark Derricutt
Thanks Mark.  looks easy enough.  i may try a maven plugin first though
as i like the idea of maven controlling all the git pushes etc

On 01/03/2018 05:05, Mark Derricutt wrote:

>
> On 1 Mar 2018, at 2:56, Ben Tatham wrote:
>
>     Sounds like you're using gitflow (master, develop, feature/*
>     branches). If
>     so, we use the jgitflow-maven-plugin instead of
>     maven-release-plugin, which
>     handles these transitions and the inherent conflicts caused by the
>     maven
>     versioning.
>
>     Unfortunately, the maintainer is no longer working on it (and says
>     he's not
>     even working in java anymore), but it still works well.
>
> For my own git-flow based releases I have the following
> |git-mvnrelease| script I have on the path:
>
> |
> #!/bin/sh
> if  ! git diff-index --quiet HEAD --;then
>      echo  "Git is dirty, clean up your mess!"
>      exit  1
> fi
>
> VERSION=`xml sel -Nx="http://maven.apache.org/POM/4.0.0"  -t -v"/x:project/x:version"  pom.xml`
> BASEVERSION=${VERSION%-SNAPSHOT}
> ARTIFACTID=`xml sel -Nx="http://maven.apache.org/POM/4.0.0"  -t -v"/x:project/x:artifactId"  pom.xml`
>
> echo  "Removing non-scm files..."
> git clean -fdi
>
> echo  "Checking master branch for updates..."
> git checkout master
> git pull origin master
>
> git flow release start$BASEVERSION  &&  mvn release:prepare release:perform&&  git flow release finish -n$BASEVERSION  &&  git push origin&&  git push origin --tags
> |
>
> This first checks my working directory is clean, just for safety,
> extracts the pom.xml version for use in branch/tag names. Switches to
> my |master| branch and makes sure it's up to date, then does a batch
> release/push.
>
> I don't think I've ever had any issues with maven versioning, unless
> the version number as part of the release/merge has changed to
> something unexpected.
>
> YMMV
> Mark
>
> ------------------------------------------------------------------------
>
> "The ease with which a change can be implemented has no relevance at
> all to whether it is the right change for the (Java) Platform for all
> time." — Mark Reinhold.
>
> Mark Derricutt
> http://www.theoryinpractice.net
> http://www.chaliceofblood.net
> http://plus.google.com/+MarkDerricutt
> http://twitter.com/talios
> http://facebook.com/mderricutt
>


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

Reply | Threaded
Open this post in threaded view
|

Re: maven release plugin

Matthew Broadhead
In reply to this post by Stephen Coy-4
thanks Stephen.  i will give this one a look too.  it looks almost
identical to jgitflow-maven-plugin.

i have had problems testing jgitflow.  it seems even if i add the
configuration parameter
<developBranchName>development</developBranchName> it still creates a
branch "develop".  also after release-finish it doesn't delete the
release branch.  also are these plugins only supposed to be run from the
master branch?

On 01/03/2018 08:25, Stephen Coy wrote:

> I have been using https://github.com/aleksandr-m/gitflow-maven-plugin <https://github.com/aleksandr-m/gitflow-maven-plugin> and found that it works quite sweetly.
>
> … and it is being actively maintained.
>
> Cheers,
>
> Steve C
>
>> On 1 Mar 2018, at 12:56 am, Ben Tatham <[hidden email]> wrote:
>>
>> Sounds like you're using gitflow (master, develop, feature/* branches).  If
>> so, we use the jgitflow-maven-plugin instead of maven-release-plugin, which
>> handles these transitions and the inherent conflicts caused by the maven
>> versioning.
>>
>> Unfortunately, the maintainer is no longer working on it (and says he's not
>> even working in java anymore), but it still works well.
>>
>> https://bitbucket.org/atlassian/jgit-flow/wiki/Home
>>
>> On Wed, Feb 28, 2018 at 7:18 AM Matthew Broadhead <
>> [hidden email]> wrote:
>>
>>> hi,
>>> not sure if this is the correct place to ask questions about the maven
>>> release plugin
>>> i am trying to set my snapshots and releases properly
>>> i am using git with a master branch and a development branch
>>> how do i work in the snapshot on development and then tag the releases
>>> to master?
>>> if you know any good tutorials online that would help as i tried a few
>>> but they didn't fit my case
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>> --
>> --
>> Ben Tatham
>> Software Architect
>>
>> *Nano**metrics* *Inc.*
>>
>> Ottawa * I*  Calgary  *I*  Houston  *I*  Beijing
>>
>> T: +1 613 505 5065  *I*  [hidden email]
>> www.nanometrics.ca  *I  *www.microseismicmonitoring.com
>>
>> This message is intended exclusively for the individual or entity to which
>> it is addressed. This communication may contain information that is
>> proprietary, privileged, confidential or otherwise legally exempt from
>> disclosure. If you are not the named addressee, or have been inadvertently
>> and erroneously referenced in the address line, you are not authorized to
>> read, print, retain, copy or disseminate this message or any part of it. If
>> you have received this message in error, please notify the sender
>> immediately by e-mail and delete all copies of the message.
>


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

Reply | Threaded
Open this post in threaded view
|

Re: maven release plugin

Matthew Broadhead
ah i missed the <flowInitContext> around the parameters.  it works now

On 01/03/2018 11:22, Matthew Broadhead wrote:

> thanks Stephen.  i will give this one a look too.  it looks almost
> identical to jgitflow-maven-plugin.
>
> i have had problems testing jgitflow.  it seems even if i add the
> configuration parameter
> <developBranchName>development</developBranchName> it still creates a
> branch "develop".  also after release-finish it doesn't delete the
> release branch.  also are these plugins only supposed to be run from
> the master branch?
>
> On 01/03/2018 08:25, Stephen Coy wrote:
>> I have been using https://github.com/aleksandr-m/gitflow-maven-plugin 
>> <https://github.com/aleksandr-m/gitflow-maven-plugin> and found that
>> it works quite sweetly.
>>
>> … and it is being actively maintained.
>>
>> Cheers,
>>
>> Steve C
>>
>>> On 1 Mar 2018, at 12:56 am, Ben Tatham <[hidden email]>
>>> wrote:
>>>
>>> Sounds like you're using gitflow (master, develop, feature/*
>>> branches).  If
>>> so, we use the jgitflow-maven-plugin instead of
>>> maven-release-plugin, which
>>> handles these transitions and the inherent conflicts caused by the
>>> maven
>>> versioning.
>>>
>>> Unfortunately, the maintainer is no longer working on it (and says
>>> he's not
>>> even working in java anymore), but it still works well.
>>>
>>> https://bitbucket.org/atlassian/jgit-flow/wiki/Home
>>>
>>> On Wed, Feb 28, 2018 at 7:18 AM Matthew Broadhead <
>>> [hidden email]> wrote:
>>>
>>>> hi,
>>>> not sure if this is the correct place to ask questions about the maven
>>>> release plugin
>>>> i am trying to set my snapshots and releases properly
>>>> i am using git with a master branch and a development branch
>>>> how do i work in the snapshot on development and then tag the releases
>>>> to master?
>>>> if you know any good tutorials online that would help as i tried a few
>>>> but they didn't fit my case
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>> --
>>> --
>>> Ben Tatham
>>> Software Architect
>>>
>>> *Nano**metrics* *Inc.*
>>>
>>> Ottawa * I*  Calgary  *I*  Houston  *I*  Beijing
>>>
>>> T: +1 613 505 5065  *I*  [hidden email]
>>> www.nanometrics.ca  *I  *www.microseismicmonitoring.com
>>>
>>> This message is intended exclusively for the individual or entity to
>>> which
>>> it is addressed. This communication may contain information that is
>>> proprietary, privileged, confidential or otherwise legally exempt from
>>> disclosure. If you are not the named addressee, or have been
>>> inadvertently
>>> and erroneously referenced in the address line, you are not
>>> authorized to
>>> read, print, retain, copy or disseminate this message or any part of
>>> it. If
>>> you have received this message in error, please notify the sender
>>> immediately by e-mail and delete all copies of the message.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


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

Reply | Threaded
Open this post in threaded view
|

Re: maven release plugin

Mark Derricutt
In reply to this post by Matthew Broadhead

On 1 Mar 2018, at 23:18, Matthew Broadhead wrote:

Thanks Mark.  looks easy enough.  i may try a maven plugin first though as i like the idea of maven controlling all the git pushes etc

I tend to NOT let maven do the git pushes, for the cases we're doing releases on a hot fix, or a support branch - where there is no release branch, and not necessarily any back merging, we've found it's easier to just let maven do the release on the current branch, and leave any branching/merging to an outside force.

On hot fix/support branches we just do a standard mvn release:prepare release:perform.

Mark


"The ease with which a change can be implemented has no relevance at all to whether it is the right change for the (Java) Platform for all time." — Mark Reinhold.

Mark Derricutt
http://www.theoryinpractice.net
http://www.chaliceofblood.net
http://plus.google.com/+MarkDerricutt
http://twitter.com/talios
http://facebook.com/mderricutt


signature.asc (546 bytes) Download Attachment