How to add local .jar file dependency to build.gradle file?

前端 未结 17 1927
攒了一身酷
攒了一身酷 2020-11-21 23:23

So I have tried to add my local .jar file dependency to my build.gradle file:

apply plugin: \'java\'

sourceSets {
    main {
        java {
            srcD         


        
17条回答
  •  南笙
    南笙 (楼主)
    2020-11-21 23:35

    The solution which worked for me is the usage of fileTree in build.gradle file. Keep the .jar which need to add as dependency in libs folder. The give the below code in dependenices block in build.gradle:

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
    }
    

提交回复
热议问题