在Maven发布插件上构建失败

时间:2015-12-25 14:28:39

标签: java git maven

我是Maven的新手,我是在使用父pom文件的多模块项目中分配的。我想将快照项目更改为发布。即使我添加了scm标签和Maven发布插件,发布:准备目标仍然会失败。

这是我在父pom.xml文件中添加的内容:

 <project>
        ...
        <scm>
            <developerConnection>scm:git:http://localhost:8181/gitblit
             /r/server/myCompany.git</developerConnection>
        </scm>
        ...


        //And the plugin:
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
        </plugin>
        ...
        <project>

这是错误:

错误是这样的:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-            
          plugin:2.5.3:prepare (default-cli) on 
          project myParentProject: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-add command failed.
[ERROR] Command output:
[ERROR] 'git' is not recognized as an internal or external command,
[ERROR] operable program or batch file..

提前致谢!

2 个答案:

答案 0 :(得分:1)

你应该安装git,显然!

如果您的操作系统类似于UNIX,请使用某种包管理器, apt-get install git用于debian衍生物和ubuntu。

如果您的操作系统是Windows,请确保git.exe上有%PATH

答案 1 :(得分:0)

请先安装GIT,然后再试一次

相关问题