Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9869

Jenkins Maven Release Plug-in fails because workspace directory does not exist

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Major Major
    • m2release-plugin
    • None
    • Mac OS X 10.6.7

      I have a multi-module maven project. It successfully builds, and the release:prepare successfully competes. However, after all of the steps (looking at console output) have completed, the whole thing fails when it tries to do something with an extra workspace directory that doesn't exist.

      Here's the last part of the exception.
      Caused by: org.codehaus.plexus.util.cli.CommandLineException: Working directory "/Users/dallwardt/.jenkins/jobs/Vault-test6/workspace/target/checkout/workspace" does not exist!
      at org.codehaus.plexus.util.cli.Commandline.execute(Commandline.java:644)
      at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine(CommandLineUtils.java:118)
      at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine(CommandLineUtils.java:93)
      at org.apache.maven.shared.invoker.DefaultInvoker.executeCommandLine(DefaultInvoker.java:149)
      at org.apache.maven.shared.invoker.DefaultInvoker.execute(DefaultInvoker.java:102)
      at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals(InvokerMavenExecutor.java:387)
      ... 36 more
      channel stopped
      Finished: FAILURE

      Here's what the file system looks like:
      dallwardt$ pwd
      /Users/dallwardt/.jenkins/jobs/Vault-test6/workspace

      dallwardt$ ls
      Common WzlDocs pom.xml pom.xml.releaseBackup release.properties target

      dallwardt$ pwd
      /Users/dallwardt/.jenkins/jobs/Vault-test6/workspace/target/checkout

      dallwardt$ ls
      dev tags trunk


      Notice there is no workspace directory under target/checkout. Who is supposed to create an extra workspace folder under target/checkout ?

          [JENKINS-9869] Jenkins Maven Release Plug-in fails because workspace directory does not exist

          James Nord added a comment -

          From the entry

          [WARNING] Base directory is a file. Using base directory as POM location.

          It looks like your SCM section in your pom is not correct, which would tie up.with the checkout having trunk,dev&tags

          If you don't think this is the case please provide a sample maven project and the full build.log.

          James Nord added a comment - From the entry [WARNING] Base directory is a file. Using base directory as POM location. It looks like your SCM section in your pom is not correct, which would tie up.with the checkout having trunk,dev&tags If you don't think this is the case please provide a sample maven project and the full build.log.

          Wow, thanks for the quick response!

          I'm not sure exactly what the base directory refers to. But I thought I would share the scm settings for the parent pom and the two modules to see if anything glaring pops out for you.

          Parent POM scm settings:
          <scm>
          <connection>
          scm:svn:https://svnhost/woozle/test6/dev/trunk
          </connection>
          <developerConnection>
          scm:svn:https://svnhost/woozle/test6/dev/trunk
          </developerConnection>
          <url>
          scm:svn:https://svnhost/woozle/test6/dev/trunk
          </url>
          </scm>

          Module Common scm settings:
          <scm>
          <connection>
          scm:svn:https://svnhost/woozle/test6/dev/trunk/Common
          </connection>
          <developerConnection>
          scm:svn:https://svnhost/woozle/test6/dev/trunk/Common
          </developerConnection>
          <url>
          scm:svn:https://svnhost/woozle/test6/dev/trunk/Common
          </url>
          </scm>

          Module WzlDocs scm settings:
          <scm>
          <connection>
          scm:svn:https://svnhost/woozle/test6/dev/trunk/WzlDocs
          </connection>
          <developerConnection>
          scm:svn:https://svnhost/woozle/test6/dev/trunk/WzlDocs
          </developerConnection>
          <url>
          scm:svn:https://svnhost/woozle/test6/dev/trunk/WzlDocs
          </url>
          </scm>

          Derek Allwardt added a comment - Wow, thanks for the quick response! I'm not sure exactly what the base directory refers to. But I thought I would share the scm settings for the parent pom and the two modules to see if anything glaring pops out for you. Parent POM scm settings: <scm> <connection> scm:svn: https://svnhost/woozle/test6/dev/trunk </connection> <developerConnection> scm:svn: https://svnhost/woozle/test6/dev/trunk </developerConnection> <url> scm:svn: https://svnhost/woozle/test6/dev/trunk </url> </scm> Module Common scm settings: <scm> <connection> scm:svn: https://svnhost/woozle/test6/dev/trunk/Common </connection> <developerConnection> scm:svn: https://svnhost/woozle/test6/dev/trunk/Common </developerConnection> <url> scm:svn: https://svnhost/woozle/test6/dev/trunk/Common </url> </scm> Module WzlDocs scm settings: <scm> <connection> scm:svn: https://svnhost/woozle/test6/dev/trunk/WzlDocs </connection> <developerConnection> scm:svn: https://svnhost/woozle/test6/dev/trunk/WzlDocs </developerConnection> <url> scm:svn: https://svnhost/woozle/test6/dev/trunk/WzlDocs </url> </scm>

          I believe the way the tagging is working is causing the problem. Below, I've copied the output from the console that I believe is relevant, and added comments [dallwardt].

          [INFO] Executing: /bin/sh c cd /Users/dallwardt/.jenkins/jobs/Vault-test6 && svn --non-interactive copy --file /var/folders/hk/hkB7h7JzF3aAutP5dS+OyE+++TI/-Tmp/maven-scm-2140088471.commit --revision 3521 https://svnhost/woozle/test6/dev https://svnhost/woozle/test6/dev/tags/woozle-1.5.0.5

          [dallwardt] copy is made from /woozle/test6/dev instead of /woozle/test6/dev/trunk. My scm settings are scm:svn:https://svnhost/woozle/test6/dev/trunk. Why is it dropping the "trunk" part of it?

          [INFO] Release preparation complete.

          [INFO] Checking out the project to perform the release ...
          [INFO] Executing: /bin/sh -c cd /Users/dallwardt/.jenkins/jobs/Vault-test6/workspace/target && svn --non-interactive checkout https://svnhost/woozle/test6/dev/tags/woozle-1.5.0.5 /Users/dallwardt/.jenkins/jobs/Vault-test6/workspace/target/checkout
          [INFO] Working directory: /Users/dallwardt/.jenkins/jobs/Vault-test6/workspace/target

          [dallwardt] /Users/dallwardt/.jenkins/jobs/Vault-test6/workspace/target/checkout contains the following:
          drwxr-xr-x 3 dallwardt staff 102 Jun 3 18:31 tags
          drwxr-xr-x 6 dallwardt staff 204 Jun 3 18:43 trunk

          [INFO] Executing goals 'deploy'...
          [WARNING] Base directory is a file. Using base directory as POM location.
          mojoFailed org.apache.maven.plugins:maven-release-plugin:2.0(default-cli)

          Derek Allwardt added a comment - I believe the way the tagging is working is causing the problem. Below, I've copied the output from the console that I believe is relevant, and added comments [dallwardt] . [INFO] Executing: /bin/sh c cd /Users/dallwardt/.jenkins/jobs/Vault-test6 && svn --non-interactive copy --file /var/folders/hk/hkB7h7JzF3aAutP5dS+OyE+++TI/-Tmp /maven-scm-2140088471.commit --revision 3521 https://svnhost/woozle/test6/dev https://svnhost/woozle/test6/dev/tags/woozle-1.5.0.5 [dallwardt] copy is made from /woozle/test6/dev instead of /woozle/test6/dev/trunk. My scm settings are scm:svn: https://svnhost/woozle/test6/dev/trunk . Why is it dropping the "trunk" part of it? [INFO] Release preparation complete. [INFO] Checking out the project to perform the release ... [INFO] Executing: /bin/sh -c cd /Users/dallwardt/.jenkins/jobs/Vault-test6/workspace/target && svn --non-interactive checkout https://svnhost/woozle/test6/dev/tags/woozle-1.5.0.5 /Users/dallwardt/.jenkins/jobs/Vault-test6/workspace/target/checkout [INFO] Working directory: /Users/dallwardt/.jenkins/jobs/Vault-test6/workspace/target [dallwardt] /Users/dallwardt/.jenkins/jobs/Vault-test6/workspace/target/checkout contains the following: drwxr-xr-x 3 dallwardt staff 102 Jun 3 18:31 tags drwxr-xr-x 6 dallwardt staff 204 Jun 3 18:43 trunk [INFO] Executing goals 'deploy'... [WARNING] Base directory is a file. Using base directory as POM location. mojoFailed org.apache.maven.plugins:maven-release-plugin:2.0(default-cli)

          James Nord added a comment -

          Try adding a trailing slash to the scm urls.

          James Nord added a comment - Try adding a trailing slash to the scm urls.

          I tried adding the trailing slash, and here's the results:

          • running mvn release:prepare release:perform from the command line works.
          • using the Jenkins release plugin still does not work.

          The release:prepare phase (in Jenkins) is removing the trailing slash, thus causing the original problem "[WARNING] Base directory is a file. Using base directory as POM location". I verified this by comparing the original pom version to the one that maven checks in on the tag.

          Why would we get different results from Maven and Jenkins (which is calling maven)?

          Derek Allwardt added a comment - I tried adding the trailing slash, and here's the results: running mvn release:prepare release:perform from the command line works. using the Jenkins release plugin still does not work. The release:prepare phase (in Jenkins) is removing the trailing slash, thus causing the original problem " [WARNING] Base directory is a file. Using base directory as POM location". I verified this by comparing the original pom version to the one that maven checks in on the tag. Why would we get different results from Maven and Jenkins (which is calling maven)?

          James Nord added a comment -

          The reason that springs to mind would be that it is using different plug in versions.

          having said that an old version of maven-relrase-plugin will fail for a different reason.

          Was the workspace cleaned before the re test?

          James Nord added a comment - The reason that springs to mind would be that it is using different plug in versions. having said that an old version of maven-relrase-plugin will fail for a different reason. Was the workspace cleaned before the re test?

          When I run it from the command line, I see this:
          [INFO] — maven-release-plugin:2.0:perform (default-cli) @ vault —

          When I look at the console output from Jenkins, I see this:
          [INFO] — maven-release-plugin:2.0:prepare (default-cli) @ vault —

          and here's the info about the Jenkins Maven Release plugin
          About Jenkins Maven Release Plug-in Plug-in 0.7.1

          Here's the command line output from mvn --version
          Apache Maven 3.0.2 (r1056850; 2011-01-08 16:58:10-0800)
          Java version: 1.6.0_24, vendor: Apple Inc.
          Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
          Default locale: en_US, platform encoding: MacRoman
          OS name: "mac os x", version: "10.6.7", arch: "x86_64", family: "mac"

          Derek Allwardt added a comment - When I run it from the command line, I see this: [INFO] — maven-release-plugin:2.0:perform (default-cli) @ vault — When I look at the console output from Jenkins, I see this: [INFO] — maven-release-plugin:2.0:prepare (default-cli) @ vault — and here's the info about the Jenkins Maven Release plugin About Jenkins Maven Release Plug-in Plug-in 0.7.1 Here's the command line output from mvn --version Apache Maven 3.0.2 (r1056850; 2011-01-08 16:58:10-0800) Java version: 1.6.0_24, vendor: Apple Inc. Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Default locale: en_US, platform encoding: MacRoman OS name: "mac os x", version: "10.6.7", arch: "x86_64", family: "mac"

          James Nord added a comment -

          Can you attach a sample maven project, with the release.properties and poms when you try to do a release.
          which version of svn are you using?

          James Nord added a comment - Can you attach a sample maven project, with the release.properties and poms when you try to do a release. which version of svn are you using?

          James Nord added a comment -

          "Was the workspace cleaned before the re test?"

          James Nord added a comment - "Was the workspace cleaned before the re test?"

          Yes, the workspace was cleaned before the test. I actually did a few tests by creating a new job as well.

          I have to take some time to create a mock project instead of sending our actual code. Hopefully I can have something ready sometime today or tonight.

          Another note. I just upgraded to Jenkins ver. 1.414. Same behavior.

          Derek Allwardt added a comment - Yes, the workspace was cleaned before the test. I actually did a few tests by creating a new job as well. I have to take some time to create a mock project instead of sending our actual code. Hopefully I can have something ready sometime today or tonight. Another note. I just upgraded to Jenkins ver. 1.414. Same behavior.

          James Nord added a comment -

          Any chance you could try with Maven 2.2.1 instead of 3.0.2 (just to rule it out).

          (otherwise it will take me a bit to get a http svn server setup).

          FWIW this is one of the setups I use for my day job - svn,http & maven 2.2.1 - so I know that should work like a charm

          James Nord added a comment - Any chance you could try with Maven 2.2.1 instead of 3.0.2 (just to rule it out). (otherwise it will take me a bit to get a http svn server setup). FWIW this is one of the setups I use for my day job - svn,http & maven 2.2.1 - so I know that should work like a charm

          Given the choice between downgrading one of our tools and being forced to cut all releases from the command line, I'd prefer to use the command line.

          I didn't think about the fact that you'd have to have a working svn server. Is there another option for us to debug this? Should/could I download some source code somewhere, and have you tell me were to set the break point?

          Derek Allwardt added a comment - Given the choice between downgrading one of our tools and being forced to cut all releases from the command line, I'd prefer to use the command line. I didn't think about the fact that you'd have to have a working svn server. Is there another option for us to debug this? Should/could I download some source code somewhere, and have you tell me were to set the break point?

          James Nord added a comment -

          The plungin doesn't do any work for tagging and all the hard work is done by maven.

          Which surprised me that it worked on the command line.
          But I still suspect some project issue.

          The question about maven 3 was more to identify the likely area not a suggestion that you cut all releases with maven2. That is if you release breaks with maven 2.2.1 I know that setup works on linux, so we are looking at environmental or project issues

          James Nord added a comment - The plungin doesn't do any work for tagging and all the hard work is done by maven. Which surprised me that it worked on the command line. But I still suspect some project issue. The question about maven 3 was more to identify the likely area not a suggestion that you cut all releases with maven2. That is if you release breaks with maven 2.2.1 I know that setup works on linux, so we are looking at environmental or project issues

          Derek Allwardt added a comment - - edited

          Downgrading to maven 2.2.1 produced a successful release. So what does that mean for Maven 3x?

          Derek Allwardt added a comment - - edited Downgrading to maven 2.2.1 produced a successful release. So what does that mean for Maven 3x?

          James Nord added a comment -

          There are differences in the Jenkins maven plugin for maven 2 and maven 3.

          I will take a look and see if I can reproduce it with a file based svn repo.

          James Nord added a comment - There are differences in the Jenkins maven plugin for maven 2 and maven 3. I will take a look and see if I can reproduce it with a file based svn repo.

          Eirik Broen added a comment -

          I have a very similar problem to the one described above. I have a multi-module project with all module POM's having one parent. The name of the module with the parent POM in it is called esa-main.

          Everything is going well up until it gets ready to execute goals 'deploy site-deploy' then gives a warning:

          [WARNING] Base directory is a file. Using base directory as POM location.

          Which results in:

          Working directory "/var/lib/jenkins/jobs/esa-release/workspace/trunk/esa-main/target/checkout/esa-main/esa-main" does not exist!

          For some reason it tags on an extra "esa-main" at the end of the path. I have tried this both from a shell (as the Jenkins user) and from Jenkins with the same result.

          The part of the main POM which sets up the release plugin:

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

          I have seen in other posts regarding similar errors that the problem might be in the project structure but I cannot see where that would be. Any help would be much appreciated!

          Eirik Broen added a comment - I have a very similar problem to the one described above. I have a multi-module project with all module POM's having one parent. The name of the module with the parent POM in it is called esa-main. Everything is going well up until it gets ready to execute goals 'deploy site-deploy' then gives a warning: [WARNING] Base directory is a file. Using base directory as POM location. Which results in: Working directory "/var/lib/jenkins/jobs/esa-release/workspace/trunk/esa-main/target/checkout/esa-main/esa-main" does not exist! For some reason it tags on an extra "esa-main" at the end of the path. I have tried this both from a shell (as the Jenkins user) and from Jenkins with the same result. The part of the main POM which sets up the release plugin: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.2.1</version> </plugin> I have seen in other posts regarding similar errors that the problem might be in the project structure but I cannot see where that would be. Any help would be much appreciated!

          Satish Vasa added a comment -

          I have exactly the same issue with Maven 3.0.2 and maven-release-plugin 2.2.1. I am using version 1.430 of Jenkins.

          Satish Vasa added a comment - I have exactly the same issue with Maven 3.0.2 and maven-release-plugin 2.2.1. I am using version 1.430 of Jenkins.

          James Nord added a comment -

          A sample project that reproduced the issue would be helpful.

          James Nord added a comment - A sample project that reproduced the issue would be helpful.

          Satish Vasa added a comment - - edited

          Attached sample projects in a zip file that contains 1 aggregator project and 2 module projects in a flattened structure.I have stubbed out SCM and Repo details.

          Satish Vasa added a comment - - edited Attached sample projects in a zip file that contains 1 aggregator project and 2 module projects in a flattened structure.I have stubbed out SCM and Repo details.

          James Nord added a comment -

          after setting the release deployment repos and configuring an svn and apache server I don't see any failures with the test project.

          I have tried Maven 3.0.2 from the command line and as a Jenkins Maven2/3 job

          Jenkins 1.433
          m2release 0.8.0
          svn 1.6.12
          ubuntu 11.04

          James Nord added a comment - after setting the release deployment repos and configuring an svn and apache server I don't see any failures with the test project. I have tried Maven 3.0.2 from the command line and as a Jenkins Maven2/3 job Jenkins 1.433 m2release 0.8.0 svn 1.6.12 ubuntu 11.04

          James Nord added a comment -

          sucessfull build result output

          James Nord added a comment - sucessfull build result output

          does this issue still exist or can we close it?

          Dominik Bartholdi added a comment - does this issue still exist or can we close it?

          evernat added a comment -

          No response from the reporter, so resolving as incomplete.
          Please reopen if needed.

          evernat added a comment - No response from the reporter, so resolving as incomplete. Please reopen if needed.

            Unassigned Unassigned
            dallwardtveeva Derek Allwardt
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: