maven-release-plugin: Perform fails with 'working directory “…workspace\\target\\checkout\\workspace” does not exist!'

こ雲淡風輕ζ 提交于 2019-12-08 06:32:23

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

  mvn org.apache.maven.plugins:maven-release-plugin:2.2.1:perform

Or you can override the dependency version in your pom

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-release-plugin</artifactId>
    <version>2.2.1</version>
  </plugin>

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?

Working directory "E:\hudson\jobs\myHudsonJob\workspace\target\checkout\workspace" does not exist!

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.

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:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.0</version>
        </plugin>
    </plugins>
</build>

This error was occurring for us

Working directory E:\Data\myproject\target\checkout does not exist!

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 the release: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). The id in the server definition for the git server needed to be the git server's hostname:

<servers>
  <server>
    <id>git-server</id>
    <username>dan</username>
    <password>changeit</password>
  </server>
<servers>

With this update, the tag completes on the server and the checkout occurred successfully.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!