# Gradle failed to load dependency

**URL:** <https://discuss.gradle.org/t/gradle-failed-to-load-dependency/30952>\
**Category:** Help/Discuss\
**Created:** [March 13, 2019, 2:32pm UTC](https://discuss.gradle.org/t/gradle-failed-to-load-dependency/30952 "2019-03-13T14:32:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diamond](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@Diamond](https://discuss.gradle.org/u/Diamond)\
**Post date:** [March 13, 2019, 2:32pm UTC](https://discuss.gradle.org/t/gradle-failed-to-load-dependency/30952/1 "2019-03-13T14:32:51Z")

</div>

I’m building “build.gradle” according to this document:  
[http://ajoberstar.org/grgit/index.html](http://ajoberstar.org/grgit/index.html)

For some reason, it couldn’t load grgit jar. I tried many ways, none of them worked.

Here is the build.gradle:

plugins {  
id ‘groovy’  
}

repositories {  
jcenter()

}

dependencies {  
implementation gradleApi()  
implementation localGroovy()  
//implementation files(‘libs/grgit-core-3.0.0.jar’)  
//implementation fileTree(dir: ‘libs’, include: [’.jar’])  
//implementation fileTree(dir: ‘libs’, include: [’.jar’])  
//compile group:‘org.ajoberstar.grgit’, name : ‘grgit-core’, version : ‘3.0.0-beta.1’  
compile ‘org.ajoberstar.grgit:grgit-core:3.0.0’

}

sourceSets {  
main {  
groovy {  
srcDirs = [‘buildSrc/src/main/groovy’]  
}  
}  
}

Here is the error:  
C:\work\MessageBrokerGradlePlugin\>gradlew build  
:buildSrc:compileJava NO-SOURCE  
:buildSrc:compileGroovy  
startup failed:  
C:\work\MessageBrokerGradlePlugin\buildSrc\src\main\groovy\ca\cooperators\mb\tasks\CloneGitRepoTask.groovy: 10: unable to resolve class org.ajoberstar.grgit.Branch  
@ line 10, column 1.  
import org.ajoberstar.grgit.Branch  
^

1 error

:buildSrc:compileGroovy FAILED

FAILURE: Build failed with an exception.

What went wrong:  
Execution failed for task ‘:buildSrc:compileGroovy’.  
Compilation failed; see the compiler error output for details.

Try:  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.  
BUILD FAILED

Total time: 4.463 secs

---

<div class="post-metadata">

**Author:** ![Diamond](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@Diamond](https://discuss.gradle.org/u/Diamond)\
**Post date:** [March 13, 2019, 9:12pm UTC](https://discuss.gradle.org/t/gradle-failed-to-load-dependency/30952/3 "2019-03-13T21:12:20Z")

</div>

this has been fixed. please close it.

---

<div class="post-metadata">

**Author:** ![alexanderLinear](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@alexanderLinear](https://discuss.gradle.org/u/alexanderLinear)\
**Post date:** [April 13, 2021, 2:10pm UTC](https://discuss.gradle.org/t/gradle-failed-to-load-dependency/30952/4 "2021-04-13T14:10:49Z")

</div>

would you be so kind and tell me how you fixed it?
