# Buildscript {} dependency : unable to resolve class JGitFlow

**URL:** <https://discuss.gradle.org/t/buildscript-dependency-unable-to-resolve-class-jgitflow/6129>\
**Category:** Old Forum Archive\
**Created:** [May 9, 2013, 2:26pm UTC](https://discuss.gradle.org/t/buildscript-dependency-unable-to-resolve-class-jgitflow/6129 "2013-05-09T14:26:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sion\_Williams1](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@Sion\_Williams1](https://discuss.gradle.org/u/Sion_Williams1)\
**Post date:** [May 9, 2013, 2:26pm UTC](https://discuss.gradle.org/t/buildscript-dependency-unable-to-resolve-class-jgitflow/6129/1 "2013-05-09T14:26:00Z")

</div>

I’m trying to use the new Atlassian JGitFlow library from within Gradle, but I seem to have errors.

```gradle
buildscript{
    repositories{
        mavenRepo (name:'Maven Central Proxy', url:'http://myserver:8089/nexus/content/repositories/central/')
    }
    dependencies{
        classpath 'com.atlassian.jgitflow:jgit-flow:0.9'
    }
  }
  task initFlow << {
    //your local working copy is now on the develop branch
    JGitFlow flow = JGitFlow.getOrInit(new File("."));
}

```

And the error is:

```gradle
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
build file 'C:\path\to\gdl-JGitFlow\build.gradle': 13: unable to resolve class JGitFlow
 @ line 13, column 14.
       JGitFlow flow = JGitFlow.getOrInit(new File("."));
                ^
  1 error
          at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileScript(DefaultScriptCompilationHandler.java:118)
        ... 53 more
    BUILD FAILED

```

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [May 9, 2013, 2:45pm UTC](https://discuss.gradle.org/t/buildscript-dependency-unable-to-resolve-class-jgitflow/6129/2 "2013-05-09T14:45:00Z")

</div>

You need to add an import for the class.

---

<div class="post-metadata">

**Author:** ![Sion\_Williams1](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@Sion\_Williams1](https://discuss.gradle.org/u/Sion_Williams1)\
**Post date:** [May 9, 2013, 3:08pm UTC](https://discuss.gradle.org/t/buildscript-dependency-unable-to-resolve-class-jgitflow/6129/3 "2013-05-09T15:08:00Z")

</div>

Thanks for the prompt reply.

I had tried that:

```gradle
buildscript{
    repositories{
        mavenRepo (name:'Maven Central Proxy', url:'http://myserver:8089/nexus/content/repositories/central/')
    }
    dependencies{
        classpath 'com.atlassian.jgitflow:jgit-flow:0.9'
    }
  }
import com.atlassian.jgitflow.core.JGitFlow
  task initFlow << {
    //your local working copy is now on the develop branch
    JGitFlow flow = JGitFlow.getOrInit(new File("."));
}

```

but still had:

```gradle
AILURE: Build failed with an exception.
  * Where:
Build file 'C:\LV\src\IdeaProjects\gdl-JGitFlow\build.gradle' line: 11
  * What went wrong:
Could not compile build file 'C:\LV\src\IdeaProjects\gdl-JGitFlow\build.gradle'.
> startup failed:
  build file 'C:\LV\src\IdeaProjects\gdl-JGitFlow\build.gradle': 11: unable to resolve class com.atlassian.jgitflow.core.JGitFlow
 @ line 11, column 1.
     import com.atlassian.jgitflow.core.JGitFlow
     ^
      1 error
    * Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  BUILD FAILED

```

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [May 9, 2013, 3:12pm UTC](https://discuss.gradle.org/t/buildscript-dependency-unable-to-resolve-class-jgitflow/6129/4 "2013-05-09T15:12:00Z")

</div>

You have the wrong dependency.

It should be: 'classpath ‘com.atlassian.jgitflow:jgit-flow-core:0.9’

---

<div class="post-metadata">

**Author:** ![Sion\_Williams1](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@Sion\_Williams1](https://discuss.gradle.org/u/Sion_Williams1)\
**Post date:** [May 9, 2013, 3:19pm UTC](https://discuss.gradle.org/t/buildscript-dependency-unable-to-resolve-class-jgitflow/6129/5 "2013-05-09T15:19:00Z")

</div>

Works perfectly! How did I miss that…
