Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update <scm><tag>...</tag></scm> #182

Closed
anton-johansson opened this issue Jul 12, 2017 · 8 comments
Closed

Update <scm><tag>...</tag></scm> #182

anton-johansson opened this issue Jul 12, 2017 · 8 comments
Assignees
Milestone

Comments

@anton-johansson
Copy link
Contributor

I've been using versions:set for a long time, and I'm moving away from the maven-release-plugin all together. I'm just missing one thing when using versions:set. I want to be able to update the <scm><tag></tag></scm> entry in my POM.

It would be awesome if I could do this through versions:set or another goal in the versions plugin.

Any plans to add something like this? Or is this functionality available somewhere else, that I have missed?

@khmarbaise
Copy link
Member

khmarbaise commented Jul 12, 2017

At the moment I don't have any plans nor request for this. This is the first in this direction......What about offering a pull request ? But it's not that trivial to do such things...

@anton-johansson
Copy link
Contributor Author

Sure, I could give it a shot, when I have time.

Would you prefer a separate goal (i. e. versions:set-scm-tag) or a parameter to versions:set (i. e. mvn versions:set -DnewVersion=1.0.0 -DscmTag=v1.0.0)?

anton-johansson added a commit to anton-johansson/versions-maven-plugin that referenced this issue Jul 13, 2017
anton-johansson added a commit to anton-johansson/versions-maven-plugin that referenced this issue Jul 13, 2017
@anton-johansson
Copy link
Contributor Author

Decided to go for a separate goal, for simplicity. See #184.

anton-johansson added a commit to anton-johansson/versions-maven-plugin that referenced this issue Jul 13, 2017
@khmarbaise
Copy link
Member

Hi, first thanks for your contribution and yes please add the information to the ReleaseNotes as well...apart from that If I correctly see the code this will only change the <scm><tag>..</tag></scm> information which is from my point of view not enough. It should also update the developerConnection and the connection as well. Otherwise you can pick the pom file and from there you can checkout the code from the correct location....

@anton-johansson
Copy link
Contributor Author

I've updated the release notes.

I'm not sure what you mean. Why would the developerConnection or connection be updated? Those are the same for any tag.

Compare this to the maven-release-plugin. It updates the version and the SCM tag and commits that before actually tagging. I would like an efficient way of doing the same, but without using the maven-release-plugin.

Here's what I would like to achieve for my release-flow:

$ git checkout [commitSHA]
$ mvn versions:set versions:set-scm-tag -DnewVersion=1.0.0 -DnewTag=v1.0.0 -DgenerateBackupPoms=false
$ git add .
$ git commit -m "Set release 1.0.0"
$ git tag v1.0.0
$ git push --tags
$ mvn deploy

@khmarbaise
Copy link
Member

khmarbaise commented Jul 15, 2017

In case of Git the tag in scm is enough, but not for Subversion. If you use Subversion this means also the scm/connection and scm/developerConnection needed to be changed according to the tag.
For example take a look here which looks like this:

<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-clean-plugin-3.0.0</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-clean-plugin-3.0.0</developerConnection>
<url>http://svn.apache.org/viewvc/maven/plugins/tags/maven-clean-plugin-3.0.0</url>
</scm>

and maybe for other version controls as well (Mercurial, Bazaar I don't know how it looks like there)...

But for the first step we have to enhance the documentation with a prominent hint about the limitation for Git only...I think that should be feasible for the moment. So could you please add the appropriate documentation to your PR...Thank you...

@anton-johansson
Copy link
Contributor Author

anton-johansson commented Jul 15, 2017

Ah, okay. That makes sense. However, the goal is currently called set-scm-tag, which would obviously only set the <tag>, and no further documentation is necessary. Maybe we should consider naming the goal update-scm, where newTag is one of the parameters. However, for now, I think updating the tag is enough. We can always add additional features when someone needs it. I aren't 100% sure how the connections should be updated for SVN or other systems in a good way, so that would be better if someone else added.

Edit: Where would you like me to document that the goal is currently mostly suited for git?

@anton-johansson
Copy link
Contributor Author

Bump: Where would you want me to document it?

olamy pushed a commit that referenced this issue Aug 17, 2017
* Add Mojo for setting the SCM tag
Closes #182

* Do not try to update SCM tag on children

* Update release notes
@olamy olamy self-assigned this Aug 17, 2017
@olamy olamy added this to the 2.5 milestone Aug 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants