Jira Git Plugin

Name Jira Git Plugin
Version 0.3-SNAPSHOT is alpha
0.2-SNAPSHOT is available
Product Versions 3.12, 3.13
Author(s) J. Longman
Homepage http://confluence.atlassian.com/display/JIRAEXT/Jira+Git+Plugin
Price Free!
License BSD with some EPL
JavaDocs  
IssueTracking JGIT Jira Developer Site
Download JAR jira_git_plugin-0.3-SNAPSHOT.jar
jira_git_plugin-0.2-SNAPSHOT.jar
Download Source http://svn.atlassian.com/svn/public/contrib/jira/jira_git_plugin/

Description/Features

Git integration into Jira, ala the Subversion plugin. Uses jgit and the original subversion jira plugin. Web integration is supported for gitweb.

0.3-SNAPSHOT since 1/Mar/09 is being used in our production environment,
0.2-SNAPSHOT should be considered Beta but workable. We are using this internally at our company. Don't let the low version number stop you!

This plugin has been updated to Java 5

Installation

Installing plugins in JIRA is easy.

Once you have downloaded or created your plugin jar, follow these steps:

  1. Shut down JIRA
  2. copy '$MY_COOL_PLUGIN.jar' into '.../atlassian-jira/WEB-INF/lib/'
  3. Start up JIRA.
  4. Go to 'Administration > Plugins' and confirm that $MY_COOL_PLUGIN is listed and enabled.
  5. Enjoy!

Usage

  1. git clone the source tree you need on your jira machine (probably as the same user jira runs as, TBD)
  2. in Jira:
    1. Go to the git Repositories panel in the Administration section
    2. Add a new repository
    3. Name it
    4. Put the path from Step 1 in the Repository root path
    5. Put the url to the git repository in the next part (note to self, can this be removed?)
    6. Choose gitweb as a web tool, you may need to customize the URLs

Examples

Version History

These versions are SNAPSHOT since the jgit library had not, as of the time of my releases, released a non-SNAPSHOT version. Maven thus prevented me from doing a release.
Release Jira Version Notes
0.1 - 29/Oct/08 3.12 Splash Landing
0.2 3.12 Second Release
0.3 alpha - 1/Mar/09 3.13 First 3.13 Alpha

Open Issues

jiraissues: Unable to determine if sort should be enabled

Building the code

jgit and maven

This plugin depends on the real [jgit|jgit] - which is available in a maven repository as a snapshot. It should be described in the pom.xml so is no longer an issue. Maven 'release' has problems with snapshot dependencies, however.

Screenshots

Labels

integration integration Delete
vcs vcs Delete
plugin plugin Delete
git git Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Feb 09

    Mick Barry says:

    I can't get this to work, keep getting an error about the repo root I specify. ...

    I can't get this to work, keep getting an error about the repo root I specify.

    Am using 0.1

    # Connection to git repository file:///var/spool/git/ssv failed: gitdir is null

    /var/spool/git/ssv is the directory that contains the .git directory

    1. Mar 06

      J. Longman says:

      Please try the latest build. Incidentally, working with the project is very eas...

      Please try the latest build.

      Incidentally, working with the project is very easy thanks to Atlassian's PDK. Checkout the code from svn, get java and maven (m2) and then the environment is self-hosting:

      mvn -Pplugin-debug

      and you've got a jira running on your machine with a developer license and the plugin with your code at http://localhost:1990/jira.

      very cool.

  2. Apr 10

    Trevor Robinson says:

    The instructions for using this plug-in say to 'git clone' the repository. Will ...

    The instructions for using this plug-in say to 'git clone' the repository. Will the plug-in periodically 'git pull' to update the cloned repository, or will it just become outdated? I'm wondering if I should instead try to run directly off the "central" repository URL (i.e. the one our developers clone from). Thanks for any guidance!

  3. Jun 10

    Ken Miller says:

    Very happy to see this plugin. We've got it hooked up and apparently working f...


    Very happy to see this plugin. We've got it hooked up and apparently working fine, but I have a question. Will this only find issue keys on commits to master? We aren't seeing git revision logs for commits to any other branches. Is there a way to enable this, or is it unsupported? If it's not supported, we care enough about this to be motivated to submit a patch...

    1. Jun 10

      J. Longman says:

      Glad to hear you've gotten it working. To answer your question, I thought tha...

      Glad to hear you've gotten it working.

      To answer your question, I thought that I had tested it and I remember it working but can't reproduce a case right now. Thinking about it - it may have worked when I was doing the fetch with a cron job and JGIT-1 changed that behaviour. I'll keep looking.

      1. Jun 10

        Ken Miller says:

        Appreciate the attention. Let me know if I can help in any way.


        Appreciate the attention. Let me know if I can help in any way.

        1. Jun 10

          J. Longman says:

          I'm not going to have a lot of time to look at it soon - in terms of open source...

          I'm not going to have a lot of time to look at it soon - in terms of open source projects that I need to look at in order to support work there's something I need hudson to do first.

          A workaround would be to add another git repository which is tracking each branch which you wish to follow. While untested, it should work.

          If you or anyone has time, the code that is relevant is in the GitManagerImpl and the RevisionIndexer. A bonus would be to show the branch in the UI, but is not urgent since you can always click on the gitweb reference. Some thought should be given to possibly explicit inclusion/exclusion of branches, depending on how much cruft accumulates in your repository.

  4. Jun 19

    Ken Miller says:

    If you have a moment, would you mind fleshing out the build instructions a bit?...


    If you have a moment, would you mind fleshing out the build instructions a bit? I've been out of the java world for a few years, and so I'm new to Maven (as well as Jira and its plugins). Are there prereqs beyond maven and java? I managed to make a little progress by adding the atlassian public repo to the pom.xml file, but there are still a few jars it can't find.

    1. Jun 19

      J. Longman says:

      I'll try to do a fresh checkout and record what I've done. My first thought is ...

      I'll try to do a fresh checkout and record what I've done. My first thought is that maybe you're not getting the jgit jar (the real jgit, i.e. java-git api, not jira-git, of course)

      1. Jun 19

        J. Longman says:

        I suspect what you need is to make your settings.xml to include the following re...

        I suspect what you need is to make your settings.xml to include the following repositories (see end of comment) - alternatively a profile.xml could be added to project, which I can't do this minute. Settings.xml should be in your ~/.m2 (or M2_REPO or whatever) and the rest of the file looks like http://confluence.atlassian.com/display/DEVNET/Example+settings.xml

        I validated this by doing mv ~/.m2 ~/.m2backup, I copied the settings.xml file form .m2backup to .m2, then

        mv ~/.m2 ~/.m2backup # so I don't use files you don't have
        cp ~/.m2backup/settings.xml ~/.m2 # see below and link
        svn co http://svn.atlassian.com/svn/public/contrib/jira/jira_git_plugin/
        cd trunk 
        mvn -Pplugin-debug
        

        Now I'm missing:

        • com.jcraft:jsch:jar:0.1.37 # version has changed repository has moved?
        • javax.transaction:jta:jar:1.0.1b # should be in sun's - a case issue ? 1.0.1b vs. 1.0.1B?
        • javax.activation:activation:jar:1.0.2 # instructions are included

        Javax jars are typically painful, you generally need to find them on sun and inject them into the maven repository as detailed when you run mvn. Any of these if you find the jar then mvn tells you how to inject it into the maven repository, so its not so bad for just 3 files.

        
                        <profile>
                                <id>jnolen-devnet-profile</id>
                                <activation>
                                        <activeByDefault>true</activeByDefault>
                                </activation>
                                <repositories>
                                        <repository>
                                                <id>atlassian-public</id>
                                                <url>https://maven.atlassian.com/repository/public</url>
                                                <snapshots>
                                                        <enabled>true</enabled>
                                                </snapshots>
                                                <releases>
                                                        <enabled>true</enabled>
                                                </releases>
                                        </repository>   
                                        <repository>
                                                <id>atlassian-m1-repository</id>
                                                <url>https://maven.atlassian.com/maven1</url>
                                                <layout>legacy</layout>
                                        </repository>
                                        <repository>
                                                <id>sun java maven repository 2</id>
                                                <url>http://download.java.net/maven/2</url>
                                        </repository>
                                        <repository>
                                                <id>iBiblio Maven2</id>
                                                <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
                                        </repository>
                                </repositories>
                                <pluginRepositories>
                                        <pluginRepository>
                                                <id>atlassian-public</id>
                                                <url>https://maven.atlassian.com/repository/public</url>
                                                <snapshots>
                                                        <enabled>true</enabled>
                                                </snapshots>
                                                <releases>
                                                        <enabled>true</enabled>
                                                </releases>
                                        </pluginRepository>
                                </pluginRepositories>
                                <properties>
                                        <downloadSources>true</downloadSources>
                                        <downloadJavadocs>true</downloadJavadocs>
                                        <!-- 
                                          Uncomment this and specify the location on your file system where your 
                                          clover license is located.
                                          <clover.licenseLocation>/path/to/clover/license</clover.licenseLocation>
                                        -->
                                        <atlassian.pdk.server.url>http://localhost:1990/confluence/</atlassian.pdk.server.url>
                                        <atlassian.pdk.server.username>admin</atlassian.pdk.server.username>
                                        <atlassian.pdk.server.password>admin</atlassian.pdk.server.password>
                                </properties>
                        </profile>
        

        I don't have time to check this now, but once those are injected, re-running mvn -Pplugin-debug should start a webserver on localhost:1990/confluence and you can start to play with the developer environment.

        1. Jun 23

          Ken Miller says:

          Thanks, this helped a lot. I'm able to build now. It may take a little while t...

          Thanks, this helped a lot. I'm able to build now. It may take a little while to get this working, unfortunately, since AFAICT I need to modify the revision index to record not just one revision per repo, but one per branch per repo. Does that sound right? A bit more involved than I'd figured/hoped, but here goes.