在build.gradle文件中加入:
jar {
manifest
{
attributes "Main-Class": "com.baeldung.fatjar.Application" }
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
http://stahlworks.com/dev/index.php?tool=zipunzip
运行下面命令行去掉多余的文件
zip -d <jar file name>.jar META-INF/*.RSA META-INF/*.DSA META-INF/*.SF
网友评论