4

I'm using Maven 3.0.3, the Maven/SCM plugin (1.5) and Git 1.7.4.1. I want to run a maven command to check out a revision of git, but the plugin is treating my "scmVersion" parameter like a branch name instead of a revision number. So, for example, if I configure

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-scm-plugin</artifactId>
    <version>1.5</version>
    <configuration>
      <goals>install</goals>
      <username>username</username>
      <password>password</password>
      <scmVersion>ccaa6881dd1a9312ad44e39eea719f33ec3e8124</scmVersion>
      <scmVersionType>revision</scmVersionType>
    </configuration>
  </plugin>

(where I have verified that the above is a valid revision), I get the error below. However, if I change "scmVersion" to be a branch name, then everything checks out fine. How do I configure the plugin to checkout from a revision? Thanks, - Dave

davea-mbp2:socialmediaproxy davea$ mvn scm:checkout
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building socialmediaproxy 0.1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-scm-plugin:1.5:checkout (default-cli) @ socialmediaproxy ---
[INFO] Removing /Users/davea/Documents/workspace-sts-2.6.0.SR1/socialmediaproxy/target/checkout
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
…
[INFO] --- maven-scm-plugin:1.5:checkout (default-cli) @ socialmediaproxy ---
[INFO] Removing /Users/davea/Documents/workspace-sts-2.6.0.SR1/socialmediaproxy/target/checkout
[INFO] Executing: /bin/sh -c cd /Users/davea/Documents/workspace-sts-2.6.0.SR1/socialmediaproxy/target && git clone http://maven:Nohw5ohr@chi-git.mydomain.com/socialmediaproxy.git /Users/davea/Documents/workspace-sts-2.6.0.SR1/socialmediaproxy/target/checkout
[INFO] Working directory: /Users/davea/Documents/workspace-sts-2.6.0.SR1/socialmediaproxy/target
[INFO] Executing: /bin/sh -c cd /Users/davea/Documents/workspace-sts-2.6.0.SR1/socialmediaproxy/target/checkout && git pull http://maven:Nohw5ohr@chi-git.mydomain.com/socialmediaproxy.gitccaa6881dd1a9312ad44e39eea719f33ec3e8124:ccaa6881dd1a9312ad44e39eea719f33ec3e8124
[INFO] Working directory: /Users/davea/Documents/workspace-sts-2.6.0.SR1/socialmediaproxy/target/checkout
[ERROR] Provider message:
[ERROR] The git-pull command failed.
[ERROR] Command output:
[ERROR] fatal: Couldn't find remote ref ccaa6881dd1a9312ad44e39eea719f33ec3e8124
Dave
  • 8,667
  • 25
  • 72
  • 90

1 Answers1

0

It's probably problem with SCM connection, try to explicitly set connectionType like this:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-scm-plugin</artifactId>
    <version>1.5</version>
    <configuration>
      <connectionType>developerConnection</connectionType>
    </configuration>
  </plugin>

You can validate if URL connections in POM are valid using command
mvn scm:validate

As it is explained here :

mvn -DscmConnection="<scm url>" -DscmDeveloperConnection="<scm url>" scm:validate

qza
  • 599
  • 4
  • 7
  • Thanks for these suggestions. THe "mvn scm:validate" command succeeds, but again, the problem isn't the connection URL, it's that when I specify a revision in the "revision" element, the plugin is interpreting that as a branch name, which wasn't what I wanted. – Dave Apr 19 '11 at 17:05