【问题标题】:'svn' is not recognized as an internal or external command'svn' 未被识别为内部或外部命令
【发布时间】:2016-07-26 23:51:55
【问题描述】:

当我尝试在 net beans IDE 上构建我的 maven 应用程序时,出现此错误,请帮助我。

Checking for local modifications: skipped.
Executing: cmd.exe /X /C "svn --non-interactive update D:\server"
Working directory: D:\server
Provider message:
The svn command failed.
Command output:
'svn' is not recognized as an internal or external command,
operable program or batch file.

------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 2.070s
Finished at: Mon Dec 17 19:24:19 IST 2012
Final Memory: 15M/175M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.1:create (default) on project red5-server: Couldn't update project. Error! -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

【问题讨论】:

  • svn 命令未在您的 PATH 环境变量中正确设置。将 PATH 设置为 svn 客户端的 /bin 文件夹。
  • 要么将 svn 添加到你的 %PATH% 环境变量(如果你安装了它),要么下载并安装 SVN。查看官方二进制包列表subversion.apache.org/packages.html#windows

标签: svn maven cmd


【解决方案1】:

我看到你正在执行这一行:

cmd.exe /X /C "svn --non-interactive update D:\server

这意味着在 %PATH% 变量中设置的任何目录中都找不到 svn.batsvn

您的 Windows 系统上是否安装了 Subversion?如果您使用了 Subversion 的 CollabNet 版本,它应该会自动更新您的 PATH 以在 %PATH% 变量中包含C:\Program Files\Subversion\bin 或类似内容。如果没有,请打开系统控制面板,转到高级选项卡,然后单击设置环境变量。找到PATH环境变量,添加svn.exe程序所在的目录。

如果您尚未安装 Subversion,请从 CollabNet、SlikSVN 或 Wandisco 安装它。

【讨论】:

【解决方案2】:

您或许应该使用javasvn 提供程序。这样,您的构建/发布将不依赖于 SVN 客户端的本地安装和设置环境变量。

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.2.2</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>
            <goals>deploy</goals>
            <tagBase>https://svn.somedomain/project/tags</tagBase>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <tagNameFormat>project-@{project.version}</tagNameFormat>
        </configuration>
</plugin>

【讨论】:

  • 我遇到了同样的错误。我正在使用发布插件版本 2.5.3 ,但没有声明 com.google.code.maven-scm-provider-svnjava 依赖关系的选项。任何建议
猜你喜欢
  • 2014-04-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-10-06
  • 2013-10-11
  • 2013-01-25
  • 2016-10-01
相关资源
最近更新 更多