maven-release-plugin:执行失败,并显示“工作目录”...workspace\target\checkout\workspace”不存在!'
我的 Maven 项目在调用release:perform时失败,尽管release;prepare按预期工作。
我发现了错误报告(如下),它看起来确实与我遇到的问题相似,但不完全确定我理解这个问题: MRELEASE516
我得到的最后几行输出:
[INFO] Executing: cmd.exe /X /C "p4 -d E:\hudson\jobs\myHudsonJob\workspace\target\checkout -p 1.1.1.1:1111: client -d myProjectWorkspace-MavenSCM-E:\hudson\jobs\myHudsonJob\workspace\target\checkout"
[INFO] Executing goals 'deploy'...
[WARNING] Base directory is a file. Using base directory as POM location.
[WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing Maven.
Working directory "E:\hudson\jobs\myHudsonJob\workspace\target\checkout\workspace" does not exist!
通过阅读错误报告可能的原因错误的原因与我的模块的结构有关,我尝试在下面概述它:
/workspace | |+ pom.xml (root pom whose parent is the build pom, | calling release:perform on this pom) | [Modules: moduleA and moduleB] | |- moduleA |+ pom.xml (parent is also build pom) |+ build/pom.xml (the build pom - no custom parent) |- moduleB |+ pom.xml (parent is build pom)
似乎根 pom 应该位于错误中“工作空间”内的某个公共目录中,但尝试过但不起作用,也不会使明白为什么我需要它。
警告基目录是一个文件希望我做什么?!然后它发现基本目录是workspace,这意味着找不到工作目录......有什么想法吗?
提前致谢。
编辑:
检查了SCM配置后,对我来说一切看起来都不错...在每个模块和我的根pom中:
<scm>
<connection>
scm:perforce:1.1.1.1:1111://rootToDirectoryContainingRelevantPom
</connection>
<developerConnection>
scm:perforce:1.1.1.1:1111://rootToDirectoryContainingRelevantPom
</developerConnection>
</scm>
编辑2:
也许我已经点击了MRELEASE -261?
I have maven project that fails when release:perform is called, though release;prepare works as expected.
I have found the bug report (below) which certainly seems to resemble the issue I have but not entirely sure I understand the problem:
MRELEASE516
The last few lines of output I get:
[INFO] Executing: cmd.exe /X /C "p4 -d E:\hudson\jobs\myHudsonJob\workspace\target\checkout -p 1.1.1.1:1111: client -d myProjectWorkspace-MavenSCM-E:\hudson\jobs\myHudsonJob\workspace\target\checkout"
[INFO] Executing goals 'deploy'...
[WARNING] Base directory is a file. Using base directory as POM location.
[WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing Maven.
Working directory "E:\hudson\jobs\myHudsonJob\workspace\target\checkout\workspace" does not exist!
From reading the bug report the possible cause of the error is related to my modules' structure, I've tried to outline it below:
/workspace | |+ pom.xml (root pom whose parent is the build pom, | calling release:perform on this pom) | [Modules: moduleA and moduleB] | |- moduleA |+ pom.xml (parent is also build pom) |+ build/pom.xml (the build pom - no custom parent) |- moduleB |+ pom.xml (parent is build pom)
It seems that the root pom should be in some common directory inside 'workspace' from the error but tried that and doesn't work, nor make sense as to why I need it.
What does the warning Base directory is a file want me to do instead?! It then figures that the base directory is workspace which then means the working directory is not found...any ideas?
Thanks in advance.
EDIT:
Having checked the SCM configuration it all looks ok to me...in each module and the root pom I have:
<scm>
<connection>
scm:perforce:1.1.1.1:1111://rootToDirectoryContainingRelevantPom
</connection>
<developerConnection>
scm:perforce:1.1.1.1:1111://rootToDirectoryContainingRelevantPom
</developerConnection>
</scm>
EDIT 2:
Maybe I have hit MRELEASE-261?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我通过使用较新版本的发布插件来完成此工作。 Maven super pom 依赖于定义的发布插件 v2.0。如果您不覆盖此设置,则将使用该版本。
您可以在运行插件时指定较新的版本
,或者您可以覆盖 pom 中的依赖项版本
I got this working by using a newer version of the release plugin. The Maven super pom has a dependency on v2.0 of the release plugin defined. If you don't override this then that the version will be used.
You can specify a newer version when you run the plugin
Or you can override the dependency version in your pom
我不确定您是否面临 MRELEASE-516 (大约是
发布:准备
)。但是,我想知道每个 POM 中的
信息是否正确。你能否证实这一点?I'm not sure you're facing MRELEASE-516 (which is about
release:prepare
). However, I wonder if you have correct<scm>
informations in each POM. Can you confirm this?我刚刚在你的日志中看到了上面的行。看起来你在某处设置了一些奇怪的路径。您是否在某处覆盖了工作区?检查您的配置并尝试尽可能消除可选设置。
I just saw the above line in your log. It looks like you have some screwy path setting somewhere. Do you overwrite the Workspace somewhere? Check your configuration and try to eliminate as much as possible the optional settings.
就我而言,相同的症状是由于 maven-release-plugin:2.2.1 中的错误造成的。请参阅 MRELEASE-705。
因此,为了消除错误,我必须将其放入父 pom 中:
In my case the same symptoms turned out to be a result of a bug in maven-release-plugin:2.2.1. See MRELEASE-705.
So to get rid of the error, I've got to put this into the parent pom:
这个错误发生在我们身上
我们正处于服务器工具的大规模转换过程中,maven 的release:prepare 似乎默默地失败了,声称标签和版本号更改已被无错误地推送。然而,经过一些研究,这些东西只被提交到本地 git 存储库,而不是推送 - 即使
release:prepare
正在执行命令来执行推送但从未报告失败 - 即使使用maven-e
和-X
命令行参数。我们使用 Maven 3.3.9、maven 发布插件 2.5.3 和 git 客户端 2.9.2。
我们的最终解决方案是在我们的 git 服务器的 maven 的
~\.m2\settings.xml
文件中添加定义(或根据您的情况进行更正)(来源master),包括具有推送标签权限(以及推送到 master)的用户名和密码。 git 服务器的服务器定义中的id
需要是 git 服务器的主机名:通过此更新,标记在服务器上完成,并且结帐成功发生。
This error was occurring for us
We're in the middle of a large transition of server tools and maven's
release:prepare
appeared to be failing silently, claiming the tags and version number changes had been pushed without error. However, after some research, these things had only been committed to the local git repository, not pushed - even though therelease:prepare
was executing commands to perform a push but never reported a failure -- even with the maven-e
and-X
command line parameters.We're using Maven 3.3.9, maven release plugin 2.5.3, and git client 2.9.2.
Our end solution was to add a (or correct the, as your case may be) definition in maven's
~\.m2\settings.xml
file for our git server (origin master) including username and password with privileges for pushing tags (as well as pushing to master). Theid
in the server definition for the git server needed to be the git server's hostname:With this update, the tag completes on the server and the checkout occurred successfully.