我正在尝试使用 maven-release-plugin 2.3.2
在多模块 POM 上。 ( maven 3.0.4)
release:prepare
工作正常但是release:perform
失败并出现此错误
[INFO] org.apache.maven.lifecycle.MissingProjectException: The goal you specified
requires a project to execute but there is no POM in this directory (...<workspace>/target
/checkout). Please verify you invoked Maven from the correct directory.
现在父 POM 位于这个 <workspace>/
中但在 <workspace>/target/checkout
没有 POM 作为 target
目录是由插件创建的。我假设这里应该有一个 pom.xml 的副本,它应该由插件创建,这就是错误的原因。
我做错了什么?附上目录和 POM 结构。模块 1 和模块 2 都有各自的 pom.xmls
在根目录中。
我看过maven release plugin, git, and the pom's not at the top , maven generating pom file , Maven 3.0's "mvn release:perform" doesn't like a pom.xml that isn't in its git repo's root directory .它们没有帮助,因为我的 pom 已经位于 repo 的 (SVN) 根目录中,而插件正在寻找 POM 的这个目录只是临时的,所以我不能/不应该对其进行硬编码。
最佳答案
修复了它.. 父 POM 标签中的错误路径。 khmarbaise 的评论让我想到 SVN=Jenkins workspace=path in 中的路径是它可以工作的唯一方式,它就是这样工作的。
关于Maven 在此目录中没有发布 POM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13874726/