gpt4 book ai didi

android - Maven 无法将 git-push 构建版本发布到存储库

转载 作者:行者123 更新时间:2023-11-30 03:22:28 24 4
gpt4 key购买 nike

在名为 foobar 的 Android 项目上,我运行 mvn release:prepare它成功构建了应用程序并将本地提交添加到 Git 存储库。然后当脚本尝试推送到远程存储库时,会发生以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:\
maven-release-plugin:2.4.1:prepare (default-cli) on project foobar: \
Unable to commit files
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] fatal: unable to connect to :
[ERROR] : Name or service not known

我使用公钥/私钥访问名为 mylocalserver 的本地服务器:

# ~/.ssh/config
Host mylocalserver-git
HostName 192.168.100.100
User git
IdentityFile ~/.ssh/id_rsa

Git 配置引用主机名并指向存储库:

# Git config
remote.mylocalserver.url=git@mylocalserver-git:foobar.git

Maven 也知道服务器:

<!-- pom.xml -->
<scm>
<developerConnection>
scm:git:git://mylocalserver-git:foobar.git
</developerConnection>
</scm>

项目目录结构如下:

├── .git
├── .settings
├── assets
├── bin
├── docs
├── gen
├── gen-external-apklibs
├── libs
├── out
├── res
├── src
├── target
├── tmp
├── .classpath
├── .gitignore
├── .project
├── AndroidManifest.xml
├── ic_launcher-web.png
├── pom.xml
├── proguard.cfg
├── project.properties
├── README

我可以通过任何 Git 命令使用远程服务器,例如 git push mylocalserver master。为什么 Maven 会失败?
我可以在 prohibit maven to push the release 时抑制错误:

最佳答案

检查 Maven Git SCM 的接受语法.你的:

scm:git:git://mylocalserver-git:foobar.git

应该是:

scm:git:git://mylocalserver-git/foobar.git

关于android - Maven 无法将 git-push 构建版本发布到存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18878343/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com