You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Thorsten Heit (JIRA)" <ji...@apache.org> on 2016/04/26 15:36:12 UTC

[jira] [Updated] (MRELEASE-549) Pin svn:externals when tagging

     [ https://issues.apache.org/jira/browse/MRELEASE-549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thorsten Heit updated MRELEASE-549:
-----------------------------------
    Attachment: maven-scm.patch

I'm also in need of such a feature and have asked about best practies for m-release-p and svn:externals some time ago; see the Maven Users list (http://maven.40175.n5.nabble.com/Best-practices-m-release-p-and-svn-externals-tt5855187.html).
Robert Scholte gave me some hints where the command line for the tag command is being constructed.

Using this information I created a quite simple patch that allows to exactly do that, i.e. use "--pin-externals" in the svn copy command used when tagging:

For simplicity I extended the $HOME/.scm/svn-settings.xml file and added a new boolean option called "<pinExternals/>". The modified SvnTagCommand class evaluates this option and adds "--pin-externals" to the SVN command line.

Executing "mvn scm:tag -Dtag=foo" using the modified 1.9.4 SCM plugin with a Subversion 1.9.3 client against a 1.8.x server successfully pins my external references :-)

When I use the unmodified version 1.9.4, it warns about an unsupported tag but seems to continue as usual:

{noformat}
$ mvn scm:status
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building foobar 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-scm-plugin:1.9.4:status (default-cli) @ foobar ---
C:\Users\thorsten\.scm\svn-settings.xml isn't well formed. SKIPPED.Unrecognised tag: 'pinExternals' (position: START_TAG seen ...<svn-settings>\n    <pinExternals>... @6:19)
[INFO] Executing: cmd.exe /X /C "svn --non-interactive status"
[INFO] Working directory: C:\Users\thorsten\workspaces\maven\foobar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.641 s
[INFO] Finished at: 2016-04-26T15:30:40+02:00
[INFO] Final Memory: 12M/155M
[INFO] ------------------------------------------------------------------------

$
{noformat}

> Pin svn:externals when tagging
> ------------------------------
>
>                 Key: MRELEASE-549
>                 URL: https://issues.apache.org/jira/browse/MRELEASE-549
>             Project: Maven Release Plugin
>          Issue Type: Improvement
>          Components: prepare
>    Affects Versions: 2.0
>            Reporter: Stephen Connolly
>            Assignee: Michael Osipov
>         Attachments: maven-scm.patch
>
>
> svn:externals is a property set on directories in a subversion repository.
> there are two classes of svn:externals, ones which specify a revision and ones which do not.
> when creating a tag, the tag should only contain svn:externals which have been pinned to specific revisions, otherwise the tag is not a tag, i.e. it is subject to change.
> A generic solution (i.e. not SVN specific) would be to add preTagGoals and postTagGoals so that a custom goal could be invoked around creating the tag.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)