"Cannot get the revision information from the scm repository"

26,005

Solution 1

A quick search on Google seems to indicate that this error is related to the buildnumber-maven-plugin. However, I couldn't reproduce the error on the command line on my machine (Maven 2.2.1, Java 1.6.0_16, svn 1.6.5 on GNU/Linux):

pascal@laptop:~/tmp/$ svn co http://wiquery.googlecode.com/svn/branches/1.0-m2 wiquery
...
pascal@laptop:~/tmp/$ cd wiquery
pascal@laptop:~/tmp/wiquery$ mvn validate
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building WiQuery project
[INFO]    task-segment: [validate]
[INFO] ------------------------------------------------------------------------
[INFO] [buildnumber:create {execution: default}]
[INFO] Checking for local modifications: skipped.
[INFO] Updating project files from SCM: skipped.
[INFO] Executing: /bin/sh -c cd /home/pascal/tmp/wiquery && svn --non-interactive info
[INFO] Working directory: /home/pascal/tmp/wiquery
[INFO] Storing buildNumber: 208 at timestamp: 1256499766371
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Sun Oct 25 20:42:46 CET 2009
[INFO] Final Memory: 13M/77M
[INFO] ------------------------------------------------------------------------
pascal@laptop:~/tmp/wiquery$ 

From what I can see on Google, possible causes of problem include:

  • svn executable (i.e. svn.exe on windows) not being on the path
  • too old svnkit version compared to your svn client (see this thread)
  • missing environment variables on OS X (see MOJO-1289)
  • etc etc

But without more information on your context, your environment, what you are doing, when this error occurs, etc, it seems hard to go further in the diagnostic.

Solution 2

I had the problem too an my solution on Windows was: to set the environment variable PATH to "...\git\bin". Java couldn't find the directory to use Git.

Solution 3

I've run into this error with the buildnumber-maven-plugin when I was helping a coworker migrate his project to Maven.

We had not yet checked the code into svn in the migrated project, so therefore the .svn folders didn't exist. Obviously it couldn't get the svn revision since the data did not exist.

The solution was to comment out the plugin, import the code to svn. Perform a build with the svn enabled code, then bring the plugin back in and troubleshoot any additional errors. (We had some issues with doUpdate when running on Hudson, so we removed those steps).

Solution 4

This error is caused by the javasvn provider in the buildnumber-maven-plugin when .svn does not exists. Either checkout your project from SVN or do not use javasvn. Without javasvn the buildnumber-maven-plugin uses command line svn client and then in this case the buildnumber-maven-plugin can proceed even without the .svn directory (but the build number is not set correctly).

I think it is a bug in the buildnumber-maven-plugin that the javasvn cannot proceed when .svn directory is missing.

Share:
26,005
Altug
Author by

Altug

Architect, coder, reader

Updated on January 14, 2021

Comments

  • Altug
    Altug over 3 years

    I get maven error :

    Cannot get the revision information from the scm repository
    

    Any idea how to solve this?

  • Altug
    Altug over 14 years
    I installed svn client and problem is gone. Thanks.
  • josh-cain
    josh-cain almost 11 years
    I've seen this as well with the wrong version of the .svn client. SVN 1.7+ uses a single directory to store all .svn files, whereas 1.6- has an .svn folder in each directory. This can cause problems for plugins that expect a .svn directory in every folder.