我是Gradle新手.我想构建一个uberjar(AKA fatjar),它包含项目的所有传递依赖项.我需要在"build.gradle"中添加哪些行?
这就是我现在所拥有的:(我几天前从某处复制过,但不记得从哪里开始.)
task uberjar(type: Jar) {
from files(sourceSets.main.output.classesDir)
manifest {
attributes 'Implementation-Title': 'Foobar',
'Implementation-Version': version,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Main-Class': mainClassName
}
}
Run Code Online (Sandbox Code Playgroud)