maven-release-plugin:执行失败,工作目录为"... workspace \ target \ checkout \ workspace";不存在!' [英] maven-release-plugin: Perform fails with 'working directory "...workspace\target\checkout\workspace" does not exist!'
问题描述
我有一个maven项目,当release:perform调用时失败,尽管release; prepare可以按预期工作.
I have maven project that fails when release:perform is called, though release;prepare works as expected.
我已经找到了下面的错误报告,该报告似乎与我所遇到的问题相似,但并不完全确定我理解该问题: MRELEASE516
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)
似乎该根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.
警告基本目录是文件想要我做什么?!然后计算出基本目录是 workspace ,这意味着找不到工作目录...有什么主意吗?
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?
谢谢.
检查了SCM配置后,对我来说一切正常……在每个模块和我拥有的root pom中:
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>
也许我点击了推荐答案
我通过使用较新版本的发行插件来完成了这项工作. Maven 超级pom 依赖于所定义的发行插件的v2.0.如果不覆盖此内容,则将使用该版本. 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. 或者您可以在pom中覆盖依赖项版本 Or you can override the dependency version in your pom 这篇关于maven-release-plugin:执行失败,工作目录为"... workspace \ target \ checkout \ workspace";不存在!'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
您可以在运行插件时指定较新的版本
You can specify a newer version when you run the plugin mvn org.apache.maven.plugins:maven-release-plugin:2.2.1:perform
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.1</version>
</plugin>