1

我在 gradle 中使用shadow插件来构建 jar 文件,我添加了构建脚本如下

buildscript {
    repositories { jcenter() }
    dependencies {
        classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.2'
    }
}

而不是要求gradle从 获取 shadow-1.2.2.jar jcenter(),我想shadow-1.2.2.jarhttp://jcenter.bintray.com/com/github/jengelman/gradle/plugins/shadow/1.2.2/获取

我只想在本地构建它,我已经把它shadow-1.2.2.jar放在 libs 文件夹中,我的构建脚本是

buildscript {
    //repositories { jcenter() }
    dependencies {
        compile fileTree(dir: 'libs', include: '*.jar')
        classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.2'
    }
}

但它不起作用请帮助!

4

1 回答 1

2

以下代码应该可以工作:

buildscript {
    dependencies {
        classpath fileTree(dir: 'libs', include: '*.jar')
    }
}

没有compilegradlebuildscript依赖项的配置。

于 2015-10-14T06:59:01.557 回答