Issue Details (XML | Word | Printable)

Key: SCM-182
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Olivier Lamy
Reporter: Dominik Winter
Votes: 5
Watchers: 11
Operations

If you were logged in you would be able to see more operations.
Maven SCM

git provider

Created: 06/Apr/06 02:21 PM   Updated: 06/Aug/08 06:54 PM
Component/s: maven-scm-provider-git
Affects Version/s: None
Fix Version/s: 1.1

Time Tracking:
Not Specified

File Attachments: 1. Text File git.patch (102 kB)
2. File git.tar.bz2 (15 kB)
3. Text File SCM-182.patch (0.6 kB)
4. File update1.patch.bz2 (11 kB)

Environment: Developed on Mac OS X 10.3.9 with git 1.2.4

Complexity: Intermediate
Testcase included: yes


 Description  « Hide
Please find the git provider as attachment.

Usefulness:
I used the git provider together with [http://maven.apache.org/plugins/maven-release-plugin|maven-release-plugin], it works fine for that use case.

Open issues:

  • the JUnit tests are "proprietary", not yet TCK. I'll fix that.

If you want to run the tests, you must have git installed and it must be in your PATH.

To run git:

  • on Windows: use Cygwin and install the binutils, openssh, openssl, rsync, curl
    than you are able to compile and install git
  • on Linux: there are packages somewhere
  • on Mac OS X: use the DarwinPorts


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Dominik Winter added a comment - 12/Jul/06 03:47 PM
POM patch

Dominik Winter added a comment - 12/Jul/06 03:48 PM
New files; contains the git provider updated for version 1.0-SNAPSHOT

Dominik Winter added a comment - 12/Jul/06 03:50 PM
patch from 2006-04-06 is obsolete

Heinrich Nirschl added a comment - 20/Oct/07 05:38 AM - edited
Attachment update1.patch.bz2 is an update of Dominik's patch to work with current versions of git (1.5.3.4) and scm (1.1-SNAPSHOT).

Mark Struberg added a comment - 13/Dec/07 07:43 AM
Hi!

Please also take a look at my implementation

web-git at http://ns1.backwork.net/git/
or
git-clone http://ns1.backwork.net/git/maven-scm-providers-git.git

It is very similar to the existing scm providers like SVN and CVS, so it is split in git-commons, gittest and gitexe submodules. It also can be extended by a gitjava module using egit very easily in the future.

It includes and successfully passes TCK tests and has been tested on Linux using git 1.5.3.3 and 1.5.3.4.


Eugene Kuleshov added a comment - 05/Apr/08 12:04 AM - edited
Mark, unfortunately your provider doesn't work on Windows, or alt least it is failing for me on clone command with the error 'git-clone' is not recognized as an internal or external command, operable program or batch file.

On windows you can't run shell scripts like that and have to run them trough the shell (e.g. using "bash git-clone" command, or run it using "git clone" instead). I've tried to replace "-" with " " in those commands and it seem fixed issue on Windows.


Jason van Zyl added a comment - 05/Apr/08 04:56 PM
I've committed this to trunk.

Torbjørn Vatn added a comment - 20/Jun/08 01:01 AM
I'm having some issues getting this provider to work sadly. So far I've tried this:

1. git cloning http://ns1.backwork.net/git/maven-scm-providers-git.git and running mvn clean install
2. vim'ing into .m2/repository/org/apache/maven/scm/maven-scm-providers/1.0/maven-scm-providers-1.0.pom and adding <module>maven-scm-providers-git</module> in the modules section of the file.
3. Adding this to my projects pom.xml:
<scm>
<connection>scm:git:git://github.com/torbjornvatn/fitnesse-pom-widget.git</connection>
<url>scm:git:git://github.com/torbjornvatn/fitnesse-pom-widget.git</url>
</scm>
4. running scm:status only gives my the error message:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot run status command :
Embedded error: Can't load the scm provider.
No such provider: 'git'.

Can anyone give my some pointers to what I'm doing wrong. I'm a big fan of git and really wants to get this maven provider working.

Thanks in advance!


Mark Struberg added a comment - 20/Jun/08 03:02 AM
The full way to get it up and running is a bit complicated, since if you like to use the git provider for releasing, no snapshot has to be in your pom.

You could either build the whole maven2 project from source, or only the scm parts.

Probably the most easiest way is to make a 'private' release of the whole maven-scm-plugin (I used the extension 'msx-1') and the maven-release-plugin. It is important that those versions are no SNAPSHOTS (otherwise the release will fail). Then use it as:

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-scm-plugin</artifactId>
        <version>1.1-msx-1</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-provider-gitexe</artifactId>
            <version>1.1-msx-1</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.0-beta-8-msx-1</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-scm-plugin</artifactId>
            <version>1.1-msx-1</version>
          </dependency>
          <dependency>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-api</artifactId>
            <version>1.1-msx-1</version>
          </dependency>          
        </dependencies>
      </plugin>
    </plugins>

This is mainly a workaround for testing the scm provider with released maven versions (I tested with 2.0.4, 2.0.8 and SNAPSHOT)
And we will get rid of all this pain if 1.1 is finally released soon.


Don Brown added a comment - 28/Jul/08 03:39 AM
For those that can't wait, I branched trunk and created a 1.1-db-1 release of the git provider, which works like a charm. No need to fork any of the maven plugins. For more information, see http://www.jroller.com/mrdon/entry/maven_enabled_project_hosting_with

Olivier Lamy added a comment - 28/Jul/08 04:15 AM
Can this branch replace the current git provider in trunk ?

Don Brown added a comment - 28/Jul/08 04:21 AM
All I did was branch the git provider in trunk so that I could release it against scm 1.0. Therefore, whenever scm 1.1 is released and included in a Maven release, this branch will no longer be necessary.

Eugene Kuleshov added a comment - 28/Jul/08 08:22 AM
Don, you don't really need to branch, fork or release plugin in order to pass by release plugin restrictions. You just need to lock snapshot version, e.g. 1.1-20080622.233710-32 from Sonatype repository at http://repository.sonatype.org/content/repositories/maven.snapshots/

Also, I think it would worth to first ask in the Maven developers list about scm release instead of screwing with the community.


Don Brown added a comment - 28/Jul/08 08:34 AM
How, in any way, is this screwing with the community? First of all, having a separate version of the scm 1.1 provider prevents you from having to modify the release plugin in order to pull in the scm plugin, and second, the code works so why not have a tagged release today for those of us that don't want to wait for Maven 1.1?

Open Source is about the freedom to be able to scratch your itch and share the solution with others; not about some ivory tower club dictating what the masses use. My branch is freely available in the Maven sandbox, so if you see something you'd like to merge back or even contribute, please feel free.


Eugene Kuleshov added a comment - 28/Jul/08 08:59 AM
Don, please read my comment. You don't need to release, just lock the version. And again, if it works, why didn't you ask for release in the Maven dev list?

Mark Struberg added a comment - 29/Jul/08 03:55 AM
Eugene, are you and Jason cleaning the snapshot repo at sonatype on a regular basis, or will the snapshot remain there 'forever'?
(I ask this, because in our company I do clean our snapshot repo every month to ensure that nobody is using snapshot versions in production).

There are many roads leading to Rome, and I have to admit that the most important part in this discussion (at least for me as author) is to hear that the plugin is useful for the community and it now works out of the box for many people. So, I'm not screwed but rather happy to hear that Don succeed using it. Plus: the more attraction it gets, the more people will try using git with maven since there is no showstopper in this scenario anymore!

I will ask for the status and plans for scm-1.1 in the scm dev list.


Olivier Lamy added a comment - 05/Aug/08 02:52 PM
As the branch in the sandbox looks to works.
We can merge it to trunk.
Objections ?

Olivier Lamy added a comment - 06/Aug/08 06:54 PM
ok no merge needed.