gradle连同依赖打到jar包

修改build.gradle

jar {
     
    manifest {
     
        attributes "Main-Class": 'com.xxx.MainClass'
    }

    from {
     
        configurations.compile.collect {
      it.isDirectory() ? it : zipTree(it) }
    }
    # 文件夹大于65535个,需要开启zip64
    zip64=true
}

你可能感兴趣的:(gradle,jar)