Using maven-release-plugin to tag and commit to non-origin

Posted by Ali G on Stack Overflow See other posts from Stack Overflow or by Ali G
Published on 2010-04-12T17:29:00Z Indexed on 2010/04/12 17:33 UTC
Read the original article Hit count: 436

Filed under:
|
|

When I do a release of my project, I want to share the source with a wider group of people than I normally do during development. The code is shared via a Git repository. To do this, I have used the following:

  • remote public repository - released code is pushed here, every week or so (http://example.com/public)
  • remote private repository - non-release code is pushed here, more than daily (http://example.com/private)

In my local git repository, I have the following remotes defined:

origin  http://example.com/private
public  http://example.com/public

I am currently trying to configure the maven-release-plugin to manage versioning of the builds, and to manage tagging and pushing of code to the public repository. In my pom.xml, I have listed the <scm/> as follows:

<scm><connection>scm:git:http://example.com/public</connection></scm>

(Removing this line will cause mvn release:prepare to fail)


However, when calling

mvn release:clean release:prepare release:perform

Maven calls

git push origin tagname

rather than pushing to the URL specified in the POM.

So the questions are:

  1. Best practice: Should I just be tagging and committing in my private repo (origin), and pushing to public manually?
  2. Can I make Maven push to the repository that I choose, rather than defaulting to origin? I felt this was implied by the requirement of the <connection/> element in <scm/>.

© Stack Overflow or respective owner

Related posts about maven-2

Related posts about git