在尝试执行发布时:准备目标,我得到以下失败:
...
[INFO] Checking in modified POMs...
[INFO] SVN commit directory: C:\dev\eclipse\workspace\xxx-parent
[INFO] Tagging release with the label xxx-parent-0.0.1...
[INFO] SVN checkout directory: C:\dev\eclipse\workspace\xxx-parent
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.603s
[INFO] Finished at: Thu Oct 22 14:43:44 CEST 2015
[INFO] Final Memory: 10M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project xxx-parent: Unable to tag SCM
[ERROR] Provider message:
[ERROR] SVN tag failed.
[ERROR] Command output:
[ERROR] svn: Commit failed (details follow):
[ERROR] svn: Commit blocked by pre-commit hook (exit code 1) with output:
[ERROR] A message is mandatory!
[ERROR] The message must comply to the following structure 'TT 12345: Some explanation'.
[ERROR] Pay attention to the white space between TT and the TT number and between the colon and the explanation.
[ERROR] The explanation after the colon should at least be 10 characters long.
[ERROR] svn: MERGE of '/svn/xxxxx/xxx-parent': 409 Conflict (https://192.19.20.56)
[ERROR] -> [Help 1]
...
该项目已在发布版的主干中更新,但不在TAGS中,看起来它正在尝试进行svn合并?是吗?如果是这样,为什么?
这是maven-release-plugin配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<dependencies>
<dependency>
<groupId>com.google.code.maven-scm-provider-svnjava</groupId>
<artifactId>maven-scm-provider-svnjava</artifactId>
<version>1.6</version>
</dependency>
</dependencies>
<configuration>
<providerImplementations>
<svn>javasvn</svn>
</providerImplementations>
<branchBase>https://192.19.20.56/svn/xxxxx/xxx-parent/BRANCHES</branchBase>
<tagBase>https://192.19.20.56/svn/xxxxx/xxx-parent/TAGS</tagBase>
<scmCommentPrefix>TT 00000: Tagging release of project ${project.name} ${project.version}, </scmCommentPrefix>
</configuration>
</plugin>
答案 0 :(得分:2)
Maven的输出包含指针:
[ERROR] svn: Commit failed (details follow):
[ERROR] svn: Commit blocked by pre-commit hook (exit code 1) with output:
[ERROR] A message is mandatory!
[ERROR] The message must comply to the following structure 'TT 12345: Some explanation'.
[ERROR] Pay attention to the white space between TT and the TT number and between the colon and the explanation.
[ERROR] The explanation after the colon should at least be 10 characters long.
您的团队安装了预提交挂钩,不允许此提交,因为提交消息丢失。我只能假设您所包含的maven-release-plugin
配置不是实际活动的配置,因为它不仅包含提交消息,还包含所需格式的消息:
<scmCommentPrefix>TT 00000: Tagging release of project ${project.name} ${project.version}, </scmCommentPrefix>
你可以这样尝试adding a commit message manually by using a command-line parameter:
mvn release:prepare -DscmCommentPrefix="TT 00000: Tagging release of project..."
答案 1 :(得分:0)
我发现的解决方案是更改发布插件使用的maven-scm-provider-svnjava的版本。 它使用的是1.6版本,我将其更改为1.15,使用此配置,我可以准备并执行发布。
subversion存储库是1.6版本,不知道我可以使用的最新版本的maven-scm-provider-svnjava是什么。