'svn'不被视为内部或外部命令

Viv*_*k P 7 svn cmd maven

当我试图在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
Run Code Online (Sandbox Code Playgroud)

Dav*_* W. 13

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

cmd.exe /X /C "svn --non-interactive update D:\server
Run Code Online (Sandbox Code Playgroud)

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

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

如果尚未安装Subversion,请从CollabNet,SlikSVN或Wandisco安装.


kpe*_*hev 10

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

<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>
Run Code Online (Sandbox Code Playgroud)