【问题标题】:Multi module maven project release with git on Windows在 Windows 上使用 git 发布多模块 maven 项目
【发布时间】:2013-03-11 00:33:07
【问题描述】:

我在pom.xml 中为多模块maven 项目配置了maven2 发布插件。该项目位于单个 git 存储库中。释放过程不适用于 Windows。

git bash 下,我总是收到父级 pom.xmlfatal: 'C:\<PATH>\pom.xml' is outside repository 错误消息。 pom.xml 已到位,并且之前已添加到存储库中。我认为由于反斜杠路径分隔符,git 无法找到它。

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

我还尝试将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>

我运行这个命令:

mvn release:prepare -B

有没有机会在 Windows 上使用带有 git 的发布插件?

【问题讨论】:

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


【解决方案1】:

请尝试&lt;developerConnection&gt;scm:git:ssh://&lt;host&gt;/&lt;project&gt;.git&lt;/developerConnection&gt;

【讨论】:

  • 添加 developerConnection 并没有改变任何东西。
猜你喜欢
  • 2011-10-07
  • 2020-05-27
  • 1970-01-01
  • 1970-01-01
  • 2012-07-16
  • 2017-07-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多