SVN 1.5.1だとmaven-release-pluginが失敗する

ある日、maven-relase-pluginを使用した「mvn release:prepare」が失敗するようになった。失敗するけど、何回か試してるとうまくいったりするという変な現象。

どうやらクライアント側のSVNをバージョンアップしたのが原因のようだ。ググるといっぱいでてくる。

JIRAにもあった。

This does appear to be an SVN "bug" in the sense that it doesn't let you tag from a non-head revision, even if all the files in and below the current directory are in fact at the latest revision for that directory on the repository. I think perhaps Maven should hide this by explicitly running an svn up prior to the svn copy - it makes sense anyways because presumably you do always want to release from the head version of what's in the repository.

http://jira.codehaus.org/browse/SCM-406?focusedCommentId=149246#action_149246

JIRAのコメントによると、SVN側の問題による影響らしい。たとえカレントディレクトリ以下のファイルが最新のリビジョンでも、タグ付けを行うときにHEADではないリビジョンから行われようとして失敗しているらしい?

そのため、maven-release-plugin側で、svn copyの前に事前にsvn upを実行してこの問題を防ごうという話がされています。

実は、たまにうまくいくというのは、失敗後に「svn up(update)」を実行してからもう1回再実行していたからみたい。