I’m trying to load an external jar, grgit-core-3.0.0.jar, into my project. Always got “unable to resolve class org.ajoberstar.grgit.Branch” error.
Here is what I did:
created a libs folder in root project directory(same level as build.gradle)
copy grgit-core-3.0.0.jar to “libs” folder
include this jar with following build.gradle
//plugin fileTree(dir: ‘libs’, include: ‘.jar’)
implementation fileTree(dir: ‘libs’, include: [’.jar’])
srcDirs = [‘buildSrc/src/main/groovy’]
- I used “import org.ajoberstar.grgit.Branch” to import branch in Groovy code, got the following error:
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.
I did a lot search to include external “.jar” file and tried many ways, none of them works.
Appreciate for help!