我正在使用google cloud dataflow来运行一个有很多依赖项的apache beam作业。通常,除非我对整个项目进行超压缩,否则dataflow将拒绝执行该图,因为依赖列表太长。
有没有办法只将项目依赖项放在uberjar中,而让我的其余数据流留在外部?我想,由于依赖关系是相当静态的,当我的项目中只有几个类发生了变化时,我可以节省大量的时间来重新编译和重新上传整个uberjar。
发布于 2018-09-06 17:55:50
例如,您可以创建仅包含compile依赖项的特定Jar任务
task uberJarDependencies(type: Jar) {
baseName "dependencies"
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}然后,gradle uberJarDependencies将生成以下jar:build/libs/dependencies.jar
https://stackoverflow.com/questions/52195711
复制相似问题