在Windows上使用git发布多模块maven项目

时间:2013-03-21 13:10:36

标签: git maven maven-2 maven-release-plugin git-bash

我在pom.xml中为多模块maven项目配置了maven2发布插件。该项目位于一个git仓库中。发布过程在Windows上不起作用。

git bash 下,我总是会收到父fatal: 'C:\<PATH>\pom.xml' is outside repository的{​​{1}}错误消息。 pom.xml已就位,之前已添加到仓库中。我认为由于反斜杠路径分隔符,git无法找到它。

我还尝试使用默认 cmd 下的发布插件。在发布过程结束时,git push hung。我认为,它正在为 ssh 密码而烦恼。在 cmd 下,我无法配置 ssh 代理,因此我必须以交互方式键入每种类型的密码。我还尝试将密码添加为命令行参数,没有任何更改。

我还尝试将pom.xml选项设置为pushChanges以防止自动推送,它也会挂起。

来自父false的相关部分:

pom.xml

我运行此命令:

<properties>
    <maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
    <timestamp>${maven.build.timestamp}</timestamp>
</properties>

<scm>
    <connection>scm:git:ssh://<host>/<project>.git</connection>
    <url><gitweb url></url>
</scm>

<!-- more here -->

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.4</version>
          <configuration>
              <tagNameFormat>
                  release-${timestamp}-v@{project.version}
              </tagNameFormat>
              <autoVersionSubmodules>true</autoVersionSubmodules>
              <pushChanges>false</pushChanges>
           </configuration>
           <executions>
              <execution>
              <id>default</id>
              <goals>
                <goal>prepare</goal>
              </goals>
           </execution>
          </executions>
        </plugin>

在Windows上有没有机会在git上使用release插件?

1 个答案:

答案 0 :(得分:0)

请尝试使用<developerConnection>scm:git:ssh://<host>/<project>.git</developerConnection>