美文网首页
gradle拷贝依赖的jar包到指定位置

gradle拷贝依赖的jar包到指定位置

作者: 雨中星辰0 | 来源:发表于2018-12-18 18:20 被阅读0次
    作者 日期
    刘权 2018-12-18

    1. 添加拷贝依赖的配置

    在项目的build.gradle文件中添加一下代码:
    注意:如果项目是一个多模块的项目,则需要把改配置加入到子模块的build.gradle中

    task copyToLib(type: Copy) {
        into "$buildDir/output/libs"
        from configurations.compile
    }
    

    2. 执行命令:gradle copyToLib

    项目的依赖包会被拷贝刚才修改的build.gradle所在目录的/build/output/libs下

    参考:
    https://stackoverflow.com/questions/14669809/how-to-copy-the-dependencies-libraries-jars-in-gradle

    相关文章

      网友评论

          本文标题:gradle拷贝依赖的jar包到指定位置

          本文链接:https://www.haomeiwen.com/subject/ppnlkqtx.html