“无法从 scm 存储库获取修订信息”

Alt*_*tug 5 java maven-2 pom.xml

我收到 Maven 错误:

Cannot get the revision information from the scm repository
Run Code Online (Sandbox Code Playgroud)

知道如何解决这个问题吗?

小智 5

我也遇到了这个问题,我在 Windows 上的解决方案是:将环境变量 PATH 设置为“...\git\bin”。Java找不到使用Git的目录。


Pas*_*ent 2

在 Google 上快速搜索似乎表明此错误与 buildnumber-maven-plugin 有关。但是,我无法在我的机器上的命令行上重现该错误(GNU/Linux 上的 Maven 2.2.1、Java 1.6.0_16、svn 1.6.5):

pascal@laptop:~/tmp/$ svn co http://wiquery.googlecode.com/svn/branches/1.0-m2 wiquery
...
pascal@laptop:~/tmp/$ cd wiquery
pascal@laptop:~/tmp/wiquery$ mvn validate
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building WiQuery project
[INFO]    task-segment: [validate]
[INFO] ------------------------------------------------------------------------
[INFO] [buildnumber:create {execution: default}]
[INFO] Checking for local modifications: skipped.
[INFO] Updating project files from SCM: skipped.
[INFO] Executing: /bin/sh -c cd /home/pascal/tmp/wiquery && svn --non-interactive info
[INFO] Working directory: /home/pascal/tmp/wiquery
[INFO] Storing buildNumber: 208 at timestamp: 1256499766371
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Sun Oct 25 20:42:46 CET 2009
[INFO] Final Memory: 13M/77M
[INFO] ------------------------------------------------------------------------
pascal@laptop:~/tmp/wiquery$ 
Run Code Online (Sandbox Code Playgroud)

从我在谷歌上看到的情况来看,问题的可能原因包括:

  • svn 可执行文件(即 Windows 上的 svn.exe)不在路径上
  • 与您的 svn 客户端相比,svnkit 版本太旧(请参阅此线程
  • OS X 上缺少环境变量(请参阅MOJO-1289
  • 等等等等

但是,如果没有有关您的上下文、环境、您正在做什么、何时发生此错误等的更多信息,似乎很难进一步进行诊断。

  • 我安装了 svn 客户端,问题就消失了。谢谢。 (3认同)