我想构建一个Uber JAR(也叫fat jar),其中包含项目的所有传递依赖项。我需要在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
}
}